Class FocusProvider
The focus provider handles the focused objects per input source.
Inheritance
FocusProvider
Implements
IEventSystemHandler
Assembly: cs.temp.dll.dll
public class FocusProvider : BaseCoreSystem, IMixedRealityEventSystem, IMixedRealityFocusProvider, IMixedRealityService, IDisposable, IMixedRealitySourceStateHandler, IMixedRealitySpeechHandler, IMixedRealityBaseInputHandler, IEventSystemHandler
Constructors
Declaration
public FocusProvider(IMixedRealityServiceRegistrar registrar, MixedRealityInputSystemProfile profile)
Parameters
Properties
The layer masks for the focus pointers to raycast against.
Declaration
public LayerMask[] FocusLayerMasks { get; }
Property Value
Type |
Description |
LayerMask[] |
|
Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action.
Declaration
public override string Name { get; }
Property Value
Overrides
The number of pointers that support far interaction (like motion controller rays, hand rays) that
are active (IsInteractionEnabled == true), excluding the gaze cursor
Declaration
public int NumFarPointersActive { get; }
Property Value
Number of IMixedRealityNearPointers that are active (IsInteractionEnabled == true).
Declaration
public int NumNearPointersActive { get; }
Property Value
Declaration
public IReadOnlyDictionary<uint, IMixedRealityPointerMediator> PointerMediators { get; }
Property Value
Declaration
public IMixedRealityPointer PrimaryPointer { get; }
Property Value
Optional Priority to reorder registered managers based on their respective priority, reduces the risk of race conditions by prioritizing the order in which managers are evaluated.
Declaration
public override uint Priority { get; }
Property Value
Overrides
Declaration
public Camera UIRaycastCamera { get; }
Property Value
Methods
Declaration
public override void Destroy()
Overrides
Generate a new unique pointer id.
Declaration
public uint GenerateNewPointerId()
Returns
Gets the currently focused object for the pointing source.
Declaration
public GameObject GetFocusedObject(IMixedRealityPointer pointingSource)
Parameters
Returns
Type |
Description |
GameObject |
Currently Focused Object.
|
Provides access to all registered pointers of a specified type.
Declaration
public IEnumerable<T> GetPointers<T>()
where T : class, IMixedRealityPointer
Returns
Type |
Description |
IEnumerable<T> |
|
Type Parameters
Name |
Description |
T |
The type of pointers to request. Use IMixedRealityPointer to access all pointers.
|
The initialize function is used to setup the service once created.
This method is called once all services have been registered in the Mixed Reality Toolkit.
Declaration
public override void Initialize()
Overrides
Checks if the pointer is registered with the Focus Manager.
Declaration
public bool IsPointerRegistered(IMixedRealityPointer pointer)
Parameters
Returns
Type |
Description |
Boolean |
True, if registered, otherwise false.
|
Raised when a source is detected.
Declaration
public void OnSourceDetected(SourceStateEventData eventData)
Parameters
Raised when a source is lost.
Declaration
public void OnSourceLost(SourceStateEventData eventData)
Parameters
Declaration
public void OnSpeechKeywordRecognized(SpeechEventData eventData)
Parameters
Registers the pointer with the Focus Manager.
Declaration
public bool RegisterPointer(IMixedRealityPointer pointer)
Parameters
Returns
Type |
Description |
Boolean |
True, if the pointer was registered, false if the pointer was previously registered.
|
Declaration
public void SubscribeToPrimaryPointerChanged(PrimaryPointerChangedHandler handler, bool invokeHandlerWithCurrentPointer)
Parameters
Gets the currently focused object for the pointing source.
Declaration
public bool TryGetFocusDetails(IMixedRealityPointer pointer, out FocusDetails focusDetails)
Parameters
Returns
Unregisters the pointer with the Focus Manager.
Declaration
public bool UnregisterPointer(IMixedRealityPointer pointer)
Parameters
Returns
Type |
Description |
Boolean |
True, if the pointer was unregistered, false if the pointer was not registered.
|
Declaration
public void UnsubscribeFromPrimaryPointerChanged(PrimaryPointerChangedHandler handler)
Parameters
Optional Update function to perform per-frame updates of the service.
Declaration
public override void Update()
Overrides
Explicit Interface Implementations
Maximum distance at which all pointers can collide with a GameObject, unless it has an override extent.
Declaration
float IMixedRealityFocusProvider.GlobalPointingExtent { get; }
Returns
Implements
IEventSystemHandler