ControllerFinder Class

Definition

ControllerFinder is a base class providing simple event handling for getting/releasing MotionController Transforms.

C++
public ref class ControllerFinder abstract : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::Input::IMixedRealitySourceStateHandler, UnityEngine::EventSystems::IEventSystemHandler
Inheritance
UnityEngine.MonoBehaviour
ControllerFinder
Implements
IMixedRealitySourceStateHandler UnityEngine.EventSystems.IEventSystemHandler

Constructors

Fields

ControllerTransform

The Transform of the currently found controller.

Properties

Handedness

The handedness of the controller that should be found.

Methods

AddControllerTransform(IMixedRealityController)

Starts to track the passed in controller's transform, assuming it meets the previously set handedness criteria.

OnControllerFound()

Override this method to act when the correct controller is actually found. This provides similar functionality to overriding AddControllerTransform, without the overhead of needing to check that handedness matches.

OnControllerLost()

Override this method to act when the correct controller is actually lost. This provides similar functionality to overriding AddControllerTransform, without the overhead of needing to check that handedness matches.

OnDisable()
OnEnable()
OnSourceDetected(SourceStateEventData)
OnSourceLost(SourceStateEventData)
RefreshControllerTransform()

Remove whichever controller is currently tracked, if any, and try to add a new one based on existing sources.

RemoveControllerTransform()

Remove whichever controller is currently tracked, if any.

TryAndAddControllerTransform()

Looks to see if the controller model already exists and registers it if so.

Applies to

Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0