Edytuj

Udostępnij za pośrednictwem


FocusProvider Class

Definition

The focus provider handles the focused objects per input source.

public ref class FocusProvider : Microsoft::MixedReality::Toolkit::BaseCoreSystem, IDisposable, Microsoft::MixedReality::Toolkit::Input::IMixedRealityFocusProvider, Microsoft::MixedReality::Toolkit::Input::IPointerPreferences, UnityEngine::EventSystems::IEventSystemHandler
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/input/overview")]
public class FocusProvider : Microsoft.MixedReality.Toolkit.BaseCoreSystem, IDisposable, Microsoft.MixedReality.Toolkit.Input.IMixedRealityFocusProvider, Microsoft.MixedReality.Toolkit.Input.IPointerPreferences, UnityEngine.EventSystems.IEventSystemHandler
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/input/overview")>]
type FocusProvider = class
    inherit BaseCoreSystem
    interface IMixedRealityFocusProvider
    interface IMixedRealityService
    interface IDisposable
    interface IMixedRealitySourceStateHandler
    interface IEventSystemHandler
    interface IMixedRealitySpeechHandler
    interface IMixedRealityBaseInputHandler
    interface IPointerPreferences
Public Class FocusProvider
Inherits BaseCoreSystem
Implements IDisposable, IEventSystemHandler, IMixedRealityFocusProvider, IPointerPreferences
Inheritance
Attributes
UnityEngine.HelpURLAttribute
Implements

Remarks

There are convenience properties for getting only Gaze Pointer if needed.

Constructors

FocusProvider(IMixedRealityServiceRegistrar, MixedRealityInputSystemProfile)
Obsolete.

Constructor.

FocusProvider(MixedRealityInputSystemProfile)

Constructor.

Fields

DefaultPriority (Inherited from BaseService)
disposed

Value indicating if the object has completed disposal.

(Inherited from BaseService)

Properties

ConfigurationProfile

The configuration profile for the service.

(Inherited from BaseService)
EventHandlersByType

List of all event handlers grouped by type that are registered to this Event System.

(Inherited from BaseEventSystem)
EventListeners

List of event listeners that are registered to this Event System.

(Inherited from BaseEventSystem)
FocusLayerMasks

The layer masks for the focus pointers to raycast against.

GazePointerBehavior

Pointer behavior for the gaze pointer. We make gaze pointer unique because the internal gaze pointer actually cannot be referenced from here since it's an internal class.

IsEnabled

Indicates whether or not the service is currently enabled.

(Inherited from BaseService)
IsInitialized

Indicates whether or not the service has been initialized.

(Inherited from BaseService)
IsMarkedDestroyed

Indicates whether or not the Destroy method been called on this service.

(Inherited from BaseService)
Name

Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action.

NumFarPointersActive

The number of pointers that support far interaction (like motion controller rays, hand rays) that are active (IsInteractionEnabled == true), excluding the gaze cursor

NumNearPointersActive

Number of IMixedRealityNearPointers that are active (IsInteractionEnabled == true).

PointerMediators
PrimaryPointer
Priority

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.

Registrar
Obsolete.

The service registrar instance that registered this service.

(Inherited from BaseCoreSystem)
UIRaycastCamera

The Camera the EventSystem uses to raycast against.

Methods

Destroy()

Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.

Disable()

Optional Disable function to pause the service.

(Inherited from BaseService)
Dispose()

Cleanup resources used by this object.

(Inherited from BaseService)
Dispose(Boolean)

Cleanup resources used by the object

(Inherited from BaseService)
Enable()

Optional Enable function to enable / re-enable the service.

(Inherited from BaseService)
GenerateNewPointerId()

Generate a new unique pointer id.

GetFocusedObject(IMixedRealityPointer)

Gets the currently focused object for the pointing source.

GetPointerBehavior(IMixedRealityPointer)

Gets the for a given pointer

GetPointerBehavior<T>(Handedness, InputSourceType)

Gets the behavior for the given pointer type.

GetPointers<T>()

Provides access to all registered pointers of a specified type.

HandleEvent<T>(BaseEventData, ExecuteEvents.EventFunction<T>)

The main function for handling and forwarding all events to their intended recipients.

(Inherited from BaseEventSystem)
Initialize()

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.

IsPointerRegistered(IMixedRealityPointer)

Checks if the pointer is registered with the Focus Manager.

LateUpdate()

Optional LateUpdate function to that is called after Update has been called on all services.

(Inherited from BaseService)
OnSourceDetected(SourceStateEventData)

Raised when a source is detected.

OnSourceLost(SourceStateEventData)

Raised when a source is lost.

OnSpeechKeywordRecognized(SpeechEventData)
Register(GameObject)

Registers a GameObject to listen for events from this Event System.

(Inherited from BaseEventSystem)
RegisterHandler<T>(IEventSystemHandler)

Registers the given handler as a global listener for all events handled via the T interface. T must be an interface type, not a class type, derived from IEventSystemHandler.

(Inherited from BaseEventSystem)
RegisterPointer(IMixedRealityPointer)

Registers the pointer with the Focus Manager.

Reset()

Optional Reset function to perform that will Reset the service, for example, whenever there is a profile change.

(Inherited from BaseService)
SetPointerBehavior<T>(Handedness, InputSourceType, PointerBehavior)

Sets the for a given pointer type, handedness, and input type

SubscribeToPrimaryPointerChanged(PrimaryPointerChangedHandler, Boolean)
TryGetFocusDetails(IMixedRealityPointer, FocusDetails)

Gets the currently focused object for the pointing source.

TryOverrideFocusDetails(IMixedRealityPointer, FocusDetails)

Sets the FocusDetails of the specified pointer, overriding the focus point that was currently set. This can be used to change the FocusDetails of a specific pointer even if focus is locked.

Unregister(GameObject)

Unregisters a GameObject from listening for events from this Event System.

(Inherited from BaseEventSystem)
UnregisterHandler<T>(IEventSystemHandler)

Unregisters the given handler as a global listener for all events handled via the T interface. T must be an interface type, not a class type, derived from IEventSystemHandler.

(Inherited from BaseEventSystem)
UnregisterPointer(IMixedRealityPointer)

Unregisters the pointer with the Focus Manager.

UnsubscribeFromPrimaryPointerChanged(PrimaryPointerChangedHandler)
Update()

Optional Update function to perform per-frame updates of the service.

Explicit Interface Implementations

IMixedRealityFocusProvider.GlobalPointingExtent

Maximum distance at which all pointers can collide with a GameObject, unless it has an override extent.

Applies to