日本語翻訳ドキュメントはサポートを終了しました

MRTK 2.6 以降のドキュメントについては、公式の Microsoft ドキュメント を参照してください。

    Show / Hide Table of Contents

    Class Interactable

    Uses input and action data to declare a set of states Maintains a collection of themes that react to state changes and provide sensory feedback Passes state information and input data on to receivers that detect patterns and does stuff.

    Inheritance
    Object
    Interactable
    Implements
    IMixedRealityFocusChangedHandler
    IMixedRealityFocusHandler
    IMixedRealityInputHandler
    IMixedRealitySpeechHandler
    IMixedRealityTouchHandler
    IMixedRealityInputHandler<Vector2>
    IMixedRealityInputHandler<Vector3>
    IMixedRealityInputHandler<MixedRealityPose>
    Namespace: Microsoft.MixedReality.Toolkit.UI
    Assembly: cs.temp.dll.dll
    Syntax
    [Serializable]
    public class Interactable : MonoBehaviour, IMixedRealityFocusChangedHandler, IMixedRealityFocusHandler, IMixedRealityInputHandler, IMixedRealitySpeechHandler, IMixedRealityTouchHandler, IMixedRealityInputHandler<Vector2>, IMixedRealityInputHandler<Vector3>, IMixedRealityInputHandler<MixedRealityPose>

    Fields

    CanDeselect

    Can the user deselect a toggle? A radial button or tab should set this to false

    Declaration
    public bool CanDeselect
    Field Value
    Type Description
    Boolean

    CanSelect

    Is the interactive selectable? When a multi-dimension button, can the user initiate switching dimensions?

    Declaration
    public bool CanSelect
    Field Value
    Type Description
    Boolean

    clickTime

    A click must occur within this many seconds after an input down

    Declaration
    protected float clickTime
    Field Value
    Type Description
    Single

    clickValidTimer

    Declaration
    protected Coroutine clickValidTimer
    Field Value
    Type Description
    Coroutine

    dimensionIndex

    Declaration
    protected int dimensionIndex
    Field Value
    Type Description
    Int32

    Dimensions

    A way of adding more layers of states for controls like toggles. This is capitalized and doesn't match conventions for backwards compatibility (to not break people using Interactable). We tried using FormerlySerializedAs("Dimensions) and renaming to "dimensions", however Unity did not properly pick up the former serialization, so we maintained the old value. See https://github.com/microsoft/MixedRealityToolkit-Unity/issues/6169

    Declaration
    protected int Dimensions
    Field Value
    Type Description
    Int32

    dragStartPosition

    The position of the controller when input down occurs. Used to determine when controller has moved far enough to trigger gesture

    Declaration
    protected Vector3? dragStartPosition
    Field Value
    Type Description
    Nullable<Vector3>

    focusingPointers

    Declaration
    protected readonly List<IMixedRealityPointer> focusingPointers
    Field Value
    Type Description
    List<IMixedRealityPointer>

    forceUpdate

    Declaration
    protected bool forceUpdate
    Field Value
    Type Description
    Boolean

    globalFeedbackClickTime

    Amount of time to "simulate" press states for interactions that do not utilize input up/down such as voice command This allows for visual feedbacks and other typical UX responsiveness and behavior to occur

    Declaration
    protected const float globalFeedbackClickTime = 0.3F
    Field Value
    Type Description
    Single

    globalTimer

    Declaration
    protected Coroutine globalTimer
    Field Value
    Type Description
    Coroutine

    handlers

    Declaration
    protected List<IInteractableHandler> handlers
    Field Value
    Type Description
    List<IInteractableHandler>

    isGlobal

    Declaration
    protected bool isGlobal
    Field Value
    Type Description
    Boolean

    lastState

    Declaration
    protected State lastState
    Field Value
    Type Description
    State

    OnClick

    Base onclick event

    Declaration
    public UnityEvent OnClick
    Field Value
    Type Description
    UnityEvent

    pressingInputSources

    Declaration
    protected readonly HashSet<IMixedRealityInputSource> pressingInputSources
    Field Value
    Type Description
    HashSet<IMixedRealityInputSource>

    rollOffTimer

    Declaration
    protected float rollOffTimer
    Field Value
    Type Description
    Single

    VoiceCommand

    This string keyword is the voice command that will fire a click on this Interactable.

    Declaration
    public string VoiceCommand
    Field Value
    Type Description
    String

    voiceRequiresFocus

    Declaration
    public bool voiceRequiresFocus
    Field Value
    Type Description
    Boolean

    Properties

    ActiveThemes

    The list of running theme instances to receive state changes When the dimension index changes, activeThemes updates to those assigned to that dimension.

    Declaration
    public IReadOnlyList<InteractableThemeBase> ActiveThemes { get; }
    Property Value
    Type Description
    IReadOnlyList<InteractableThemeBase>

    ButtonMode

    Returns the current selection mode of the Interactable based on the number of Dimensions available

    Declaration
    public SelectionModes ButtonMode { get; }
    Property Value
    Type Description
    SelectionModes
    Remarks

    Returns the following under the associated conditions: SelectionModes.Invalid => Dimensions less than or equal to 0 SelectionModes.Button => Dimensions == 1 SelectionModes.Toggle => Dimensions == 2 SelectionModes.MultiDimension => Dimensions > 2

    ClickCount

    How many times this interactable was clicked

    Declaration
    public int ClickCount { get; }
    Property Value
    Type Description
    Int32
    Remarks

    Useful for checking when a click event occurs.

    CurrentDimension

    Current Dimension index based zero and must be less than Dimensions

    Declaration
    public int CurrentDimension { get; set; }
    Property Value
    Type Description
    Int32

    Enabled

    Is the interactable enabled?

    Declaration
    [Obsolete("Use IsEnabled instead")]
    public bool Enabled { get; set; }
    Property Value
    Type Description
    Boolean

    FocusEnabled

    Does this interactable require focus

    Declaration
    [Obsolete("Use IsGlobal instead")]
    public bool FocusEnabled { get; set; }
    Property Value
    Type Description
    Boolean

    FocusingPointers

    Pointers that are focusing the interactable

    Declaration
    public List<IMixedRealityPointer> FocusingPointers { get; }
    Property Value
    Type Description
    List<IMixedRealityPointer>

    HasCollision

    State that corresponds to Interactable is touching another object

    Declaration
    public virtual bool HasCollision { get; set; }
    Property Value
    Type Description
    Boolean

    HasCustom

    State that corresponds to miscellaneous/custom use by consumers Currently not controlled by Interactable directly

    Declaration
    public virtual bool HasCustom { get; set; }
    Property Value
    Type Description
    Boolean

    HasFocus

    Has focus

    Declaration
    public virtual bool HasFocus { get; set; }
    Property Value
    Type Description
    Boolean

    HasGesture

    Currently pressed and some movement has occurred

    Declaration
    public virtual bool HasGesture { get; set; }
    Property Value
    Type Description
    Boolean

    HasGestureMax

    State that corresponds to Gesture reaching max threshold or limits

    Declaration
    public virtual bool HasGestureMax { get; set; }
    Property Value
    Type Description
    Boolean

    HasGrab

    A near interaction grabbable is actively being grabbed

    Declaration
    public virtual bool HasGrab { get; set; }
    Property Value
    Type Description
    Boolean

    HasObservation

    State that corresponds to no focus,and finger is down. Currently not controlled by Interactable directly

    Declaration
    public virtual bool HasObservation { get; set; }
    Property Value
    Type Description
    Boolean

    HasObservationTargeted

    State that corresponds to has focus,and finger down. Currently not controlled by Interactable directly

    Declaration
    public virtual bool HasObservationTargeted { get; set; }
    Property Value
    Type Description
    Boolean

    HasPhysicalTouch

    A near interaction touchable is actively being touched

    Declaration
    public virtual bool HasPhysicalTouch { get; set; }
    Property Value
    Type Description
    Boolean

    HasPress

    Currently being pressed

    Declaration
    public virtual bool HasPress { get; set; }
    Property Value
    Type Description
    Boolean

    HasVoiceCommand

    A voice command has just occurred

    Declaration
    public virtual bool HasVoiceCommand { get; set; }
    Property Value
    Type Description
    Boolean

    InputAction

    The Interactable will only respond to input down events fired with the corresponding assigned Input Action. Available input actions are populated via the Input Actions Profile under the MRTK Input System Profile assigned in the current scene

    Declaration
    public MixedRealityInputAction InputAction { get; set; }
    Property Value
    Type Description
    MixedRealityInputAction

    InteractableEvents

    List of events added to this interactable

    Declaration
    public List<InteractableEvent> InteractableEvents { get; set; }
    Property Value
    Type Description
    List<InteractableEvent>

    IsDisabled

    Is disabled

    Declaration
    [Obsolete("Use IsEnabled instead")]
    public bool IsDisabled { get; set; }
    Property Value
    Type Description
    Boolean

    IsEnabled

    Defines whether the Interactable is enabled or not internally This is different than the Enabled property at the GameObject/Component level When false, Interactable will continue to run in Unity but not respond to Input.

    Declaration
    public virtual bool IsEnabled { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Property is useful for disabling UX, such as greying out a button, until a user completes some pre-mandatory step such as fill out their name, etc

    IsGlobal

    If true, this Interactable will listen globally for any IMixedRealityInputHandler input events. These include general input up/down and clicks. If false, this Interactable will only respond to general input click events if the pointer target is this GameObject's, or one of its children's, collider.

    Declaration
    public bool IsGlobal { get; set; }
    Property Value
    Type Description
    Boolean

    IsInteractive

    State that corresponds to no focus,and finger is up. Currently not controlled by Interactable directly

    Declaration
    public virtual bool IsInteractive { get; set; }
    Property Value
    Type Description
    Boolean

    IsTargeted

    Targeted means the item has focus and finger is up Currently not controlled by Interactable directly

    Declaration
    public virtual bool IsTargeted { get; set; }
    Property Value
    Type Description
    Boolean

    IsToggleButton

    True if Selection is "Toggle" (Dimensions == 2)

    Declaration
    [Obsolete("Use ButtonMode to test if equal to SelectionModes.Toggle instead")]
    public bool IsToggleButton { get; }
    Property Value
    Type Description
    Boolean

    IsToggled

    Determines whether Interactable is toggled or not. If true, CurrentDimension should be 1 and if false, CurrentDimension should be 0

    Declaration
    public virtual bool IsToggled { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Only valid when ButtonMode == SelectionMode.Toggle (i.e Dimensions == 2)

    IsVisited

    The Interactable has been clicked

    Declaration
    public virtual bool IsVisited { get; set; }
    Property Value
    Type Description
    Boolean

    NumOfDimensions

    A way of adding more layers of states for controls like toggles

    Declaration
    public int NumOfDimensions { get; set; }
    Property Value
    Type Description
    Int32

    PressingInputSources

    Input sources that are pressing the interactable

    Declaration
    public HashSet<IMixedRealityInputSource> PressingInputSources { get; }
    Property Value
    Type Description
    HashSet<IMixedRealityInputSource>

    Profiles

    List of profile configurations that match Visual Themes with GameObjects targets Setting at runtime will re-create the runtime Theme Engines (i.e ActiveThemes property) being used by this class

    Declaration
    public List<InteractableProfileItem> Profiles { get; set; }
    Property Value
    Type Description
    List<InteractableProfileItem>

    RequiresFocus

    Do voice commands require focus?

    Declaration
    [Obsolete("Use VoiceRequiresFocus instead")]
    public bool RequiresFocus { get; set; }
    Property Value
    Type Description
    Boolean

    ResetOnDestroy

    If true, when this component is destroyed, active themes will reset their modified properties to original values on the targeted GameObjects. If false, GameObject properties will remain as-is.

    Declaration
    public bool ResetOnDestroy { get; set; }
    Property Value
    Type Description
    Boolean

    RollOffTime

    Allows for switching colliders without firing a lose focus immediately for advanced controls like drop-downs

    Declaration
    public float RollOffTime { get; protected set; }
    Property Value
    Type Description
    Single

    StateManager

    The state logic class for storing and comparing states which determines the current value.

    Declaration
    public InteractableStates StateManager { get; protected set; }
    Property Value
    Type Description
    InteractableStates

    States

    ScriptableObject to reference for basic state logic to follow when interacting and transitioning between states. Should generally be "DefaultInteractableStates" object

    Declaration
    public States States { get; set; }
    Property Value
    Type Description
    States

    VoiceRequiresFocus

    Does the voice command require this to have focus? Registers as a global listener for speech commands, ignores input events

    Declaration
    public bool VoiceRequiresFocus { get; set; }
    Property Value
    Type Description
    Boolean

    Methods

    AddHandler(IInteractableHandler)

    Register OnClick extra handlers

    Declaration
    public void AddHandler(IInteractableHandler handler)
    Parameters
    Type Name Description
    IInteractableHandler handler

    AddReceiver<T>()

    Event receivers can be used to listen for different events at runtime. This method allows receivers to be dynamically added at runtime.

    Declaration
    public T AddReceiver<T>()
        where T : ReceiverBase, new()
    Returns
    Type Description
    T

    The new event receiver

    Type Parameters
    Name Description
    T

    Awake()

    Declaration
    protected virtual void Awake()

    CanInteract()

    Based on button settings and state, should this button listen to input?

    Declaration
    protected virtual bool CanInteract()
    Returns
    Type Description
    Boolean

    ConvertToSelectionMode(Int32)

    Helper method to convert number of dimensions to the appropriate SelectionModes

    Declaration
    public static SelectionModes ConvertToSelectionMode(int dimensions)
    Parameters
    Type Name Description
    Int32 dimensions

    number of dimensions

    Returns
    Type Description
    SelectionModes

    SelectionModes for corresponding number of dimensions

    DecreaseDimension()

    Decreases the Current Dimension by 1. If at zero, then loop around to end (i.e Dimensions - 1)

    Declaration
    public void DecreaseDimension()

    ForceUpdateThemes()

    Force re-initialization of Interactable from events, themes and state references

    Declaration
    [Obsolete("Use RefreshSetup() instead")]
    public void ForceUpdateThemes()

    GetDefaultInteractableStates()

    Creates the default States ScriptableObject configured for Interactable

    Declaration
    public static States GetDefaultInteractableStates()
    Returns
    Type Description
    States

    Default Interactable States asset

    GetDefaultThemeAsset(List<ThemeDefinition>)

    Helper function to create a new Theme asset using Default Interactable States and provided theme definitions

    Declaration
    public static Theme GetDefaultThemeAsset(List<ThemeDefinition> themeDefintions)
    Parameters
    Type Name Description
    List<ThemeDefinition> themeDefintions

    List of Theme Definitions to associate with Theme asset

    Returns
    Type Description
    Theme

    Theme ScriptableObject instance

    GetDimensionIndex()

    A public way to access the current dimension

    Declaration
    [Obsolete("Use CurrentDimension property instead")]
    public int GetDimensionIndex()
    Returns
    Type Description
    Int32

    GetReceiver<T>()

    Returns the first receiver of type T on the interactable, or null if nothing is found.

    Declaration
    public T GetReceiver<T>()
        where T : ReceiverBase
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    GetReceivers<T>()

    Returns all receivers of type T on the interactable. If nothing is found, returns empty list.

    Declaration
    public List<T> GetReceivers<T>()
        where T : ReceiverBase
    Returns
    Type Description
    List<T>
    Type Parameters
    Name Description
    T

    GetStates()

    Returns a list of states assigned to the Interactable

    Declaration
    [Obsolete("Use States.StateList instead")]
    public State[] GetStates()
    Returns
    Type Description
    State[]

    GetStateValue(InteractableStates.InteractableStateEnum)

    Grabs the state value index, returns -1 if no StateManager available

    Declaration
    public int GetStateValue(InteractableStates.InteractableStateEnum state)
    Parameters
    Type Name Description
    InteractableStates.InteractableStateEnum state
    Returns
    Type Description
    Int32

    GlobalVisualReset(Single)

    Clears up any automated visual states

    Declaration
    protected IEnumerator GlobalVisualReset(float time)
    Parameters
    Type Name Description
    Single time
    Returns
    Type Description
    IEnumerator

    IncreaseDimension()

    Increases the Current Dimension by 1. If at end (i.e Dimensions - 1), then loop around to beginning (i.e 0)

    Declaration
    public void IncreaseDimension()

    Initialize()

    Declaration
    protected virtual void Initialize()

    InputDownTimer(Single)

    A timer for the MixedRealityInputHandlers, clicks should occur within a certain time.

    Declaration
    protected IEnumerator InputDownTimer(float time)
    Parameters
    Type Name Description
    Single time
    Returns
    Type Description
    IEnumerator

    OnBeforeFocusChange(FocusEventData)

    Declaration
    public void OnBeforeFocusChange(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData

    OnDestroy()

    Declaration
    protected virtual void OnDestroy()

    OnDisable()

    Declaration
    protected virtual void OnDisable()

    OnEnable()

    Declaration
    protected virtual void OnEnable()

    OnFocusChanged(FocusEventData)

    Declaration
    public void OnFocusChanged(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData

    OnFocusEnter(FocusEventData)

    Declaration
    public void OnFocusEnter(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData

    OnFocusExit(FocusEventData)

    Declaration
    public void OnFocusExit(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData

    OnInputChanged(InputEventData<MixedRealityPose>)

    Declaration
    public void OnInputChanged(InputEventData<MixedRealityPose> eventData)
    Parameters
    Type Name Description
    InputEventData<MixedRealityPose> eventData

    OnInputChanged(InputEventData<Vector2>)

    Declaration
    public void OnInputChanged(InputEventData<Vector2> eventData)
    Parameters
    Type Name Description
    InputEventData<Vector2> eventData

    OnInputChanged(InputEventData<Vector3>)

    Declaration
    public void OnInputChanged(InputEventData<Vector3> eventData)
    Parameters
    Type Name Description
    InputEventData<Vector3> eventData

    OnInputDown(InputEventData)

    Declaration
    public void OnInputDown(InputEventData eventData)
    Parameters
    Type Name Description
    InputEventData eventData

    OnInputUp(InputEventData)

    Declaration
    public void OnInputUp(InputEventData eventData)
    Parameters
    Type Name Description
    InputEventData eventData

    OnPositionInputChanged(InputEventData<Vector2>)

    Declaration
    public void OnPositionInputChanged(InputEventData<Vector2> eventData)
    Parameters
    Type Name Description
    InputEventData<Vector2> eventData

    OnSpeechKeywordRecognized(SpeechEventData)

    Voice commands from MixedRealitySpeechCommandProfile, keyword recognized

    Declaration
    public void OnSpeechKeywordRecognized(SpeechEventData eventData)
    Parameters
    Type Name Description
    SpeechEventData eventData

    OnTouchCompleted(HandTrackingInputEventData)

    Declaration
    public void OnTouchCompleted(HandTrackingInputEventData eventData)
    Parameters
    Type Name Description
    HandTrackingInputEventData eventData

    OnTouchStarted(HandTrackingInputEventData)

    Declaration
    public void OnTouchStarted(HandTrackingInputEventData eventData)
    Parameters
    Type Name Description
    HandTrackingInputEventData eventData

    OnTouchUpdated(HandTrackingInputEventData)

    Declaration
    public void OnTouchUpdated(HandTrackingInputEventData eventData)
    Parameters
    Type Name Description
    HandTrackingInputEventData eventData

    RefreshSetup()

    Force re-initialization of Interactable from events, themes and state references

    Declaration
    public void RefreshSetup()
    Remarks

    This recreates the state machine inside Interactable and thus wipes any pre-existing state values held

    RemoveHandler(IInteractableHandler)

    Remove onClick handlers

    Declaration
    public void RemoveHandler(IInteractableHandler handler)
    Parameters
    Type Name Description
    IInteractableHandler handler

    ResetAllStates()

    Reset all states in the Interactable and pointer information

    Declaration
    public void ResetAllStates()

    ResetBaseStates()

    Resets input tracking states such as focus or grab that are directly controlled by Interactable

    Declaration
    [Obsolete("Use ResetInputTrackingStates property instead")]
    public void ResetBaseStates()

    ResetInputTrackingStates()

    Reset the input tracking states directly managed by Interactable such as whether the component has focus or is being grabbed Useful for when needing to reset input interactions

    Declaration
    public void ResetInputTrackingStates()

    ResolveInputAction(Int32)

    Assigns the InputAction based on the InputActionId

    Declaration
    public static MixedRealityInputAction ResolveInputAction(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    MixedRealityInputAction

    SendOnClick(IMixedRealityPointer)

    Call onClick methods on receivers or IInteractableHandlers

    Declaration
    protected void SendOnClick(IMixedRealityPointer pointer)
    Parameters
    Type Name Description
    IMixedRealityPointer pointer

    SendVoiceCommands(String, Int32, Int32)

    call OnVoinceCommand methods on receivers or IInteractableHandlers

    Declaration
    protected void SendVoiceCommands(string command, int index, int length)
    Parameters
    Type Name Description
    String command
    Int32 index
    Int32 length

    SetCollision(Boolean)

    Change the collision state

    Declaration
    [Obsolete("Use HasCollision property instead")]
    public virtual void SetCollision(bool collision)
    Parameters
    Type Name Description
    Boolean collision

    SetCustom(Boolean)

    Change the custom state

    Declaration
    [Obsolete("Use HasCustom property instead")]
    public virtual void SetCustom(bool custom)
    Parameters
    Type Name Description
    Boolean custom

    SetDimensionIndex(Int32)

    a public way to set the dimension index

    Declaration
    [Obsolete("Use CurrentDimension property instead")]
    public void SetDimensionIndex(int index)
    Parameters
    Type Name Description
    Int32 index

    SetDisabled(Boolean)

    Change the disabled state, will override the Enabled property

    Declaration
    [Obsolete("Use IsEnabled property instead")]
    public virtual void SetDisabled(bool disabled)
    Parameters
    Type Name Description
    Boolean disabled

    SetFocus(Boolean)

    Handle focus state changes

    Declaration
    [Obsolete("Use Focus property instead")]
    public virtual void SetFocus(bool focus)
    Parameters
    Type Name Description
    Boolean focus

    SetGesture(Boolean)

    Change the gesture state

    Declaration
    [Obsolete("Use HasGesture property instead")]
    public virtual void SetGesture(bool gesture)
    Parameters
    Type Name Description
    Boolean gesture

    SetGestureMax(Boolean)

    Change the gesture max state

    Declaration
    [Obsolete("Use HasGestureMax property instead")]
    public virtual void SetGestureMax(bool gesture)
    Parameters
    Type Name Description
    Boolean gesture

    SetGrab(Boolean)

    Change the grab state

    Declaration
    [Obsolete("Use HasGrab property instead")]
    public virtual void SetGrab(bool grab)
    Parameters
    Type Name Description
    Boolean grab

    SetInputDown()

    Public method that can be used to set state of interactable corresponding to an input going down (select button, menu button, touch)

    Declaration
    public void SetInputDown()

    SetInputUp()

    Public method that can be used to set state of interactable corresponding to an input going up.

    Declaration
    public void SetInputUp()

    SetInteractive(Boolean)

    Change the Interactive state

    Declaration
    [Obsolete("Use IsInteractive property instead")]
    public virtual void SetInteractive(bool interactive)
    Parameters
    Type Name Description
    Boolean interactive

    SetObservation(Boolean)

    Change the observation state

    Declaration
    [Obsolete("Use HasObservation property instead")]
    public virtual void SetObservation(bool observation)
    Parameters
    Type Name Description
    Boolean observation

    SetObservationTargeted(Boolean)

    Change the observation targeted state

    Declaration
    [Obsolete("Use HasObservationTargeted property instead")]
    public virtual void SetObservationTargeted(bool targeted)
    Parameters
    Type Name Description
    Boolean targeted

    SetPhysicalTouch(Boolean)

    Change the physical touch state

    Declaration
    [Obsolete("Use HasPhysicalTouch property instead")]
    public virtual void SetPhysicalTouch(bool touch)
    Parameters
    Type Name Description
    Boolean touch

    SetPress(Boolean)

    Change the press state

    Declaration
    [Obsolete("Use Press property instead")]
    public virtual void SetPress(bool press)
    Parameters
    Type Name Description
    Boolean press

    SetState(InteractableStates.InteractableStateEnum, Boolean)

    a public way to set state directly

    Declaration
    public void SetState(InteractableStates.InteractableStateEnum state, bool value)
    Parameters
    Type Name Description
    InteractableStates.InteractableStateEnum state
    Boolean value

    SetTargeted(Boolean)

    Change the targeted state

    Declaration
    [Obsolete("Use IsTargeted property instead")]
    public virtual void SetTargeted(bool targeted)
    Parameters
    Type Name Description
    Boolean targeted

    SetToggled(Boolean)

    Change the toggled state

    Declaration
    [Obsolete("Use IsToggled property instead")]
    public virtual void SetToggled(bool toggled)
    Parameters
    Type Name Description
    Boolean toggled

    SetupEvents()

    Creates the event receiver instances from the Events list

    Declaration
    protected virtual void SetupEvents()

    SetupStates()

    starts the StateManager

    Declaration
    protected virtual void SetupStates()

    SetVisited(Boolean)

    Change the visited state

    Declaration
    [Obsolete("Use IsVisited property instead")]
    public virtual void SetVisited(bool visited)
    Parameters
    Type Name Description
    Boolean visited

    SetVoiceCommand(Boolean)

    Change the voice command state

    Declaration
    [Obsolete("Use HasVoiceCommand property instead")]
    public virtual void SetVoiceCommand(bool voice)
    Parameters
    Type Name Description
    Boolean voice

    ShouldListenToUpDownEvent(InputEventData)

    Based on inputAction and state, should interactable listen to this up/down event.

    Declaration
    protected virtual bool ShouldListenToUpDownEvent(InputEventData data)
    Parameters
    Type Name Description
    InputEventData data
    Returns
    Type Description
    Boolean

    Start()

    Declaration
    protected virtual void Start()

    StartClickTimer(Boolean)

    Starts a timer to check if input is in progress

    • Make sure global pointer events are not double firing
    • Make sure Global Input events are not double firing
    • Make sure pointer events are not duplicating an input event
    Declaration
    protected void StartClickTimer(bool isFromInputDown = false)
    Parameters
    Type Name Description
    Boolean isFromInputDown

    StartGlobalVisual(Boolean)

    For input "clicks" that do not have corresponding input up/down tracking such as voice commands Simulate pressed and start timer to reset states after some click time

    Declaration
    protected void StartGlobalVisual(bool voiceCommand = false)
    Parameters
    Type Name Description
    Boolean voiceCommand

    StopClickTimer()

    Declaration
    protected void StopClickTimer()

    TriggerOnClick()

    A public way to trigger or route an onClick event from an external source, like PressableButton

    Declaration
    public void TriggerOnClick()

    Update()

    Declaration
    protected virtual void Update()

    UpdateActiveThemes()

    Updates the list of active themes based the current dimensions index

    Declaration
    protected virtual void UpdateActiveThemes()

    UpdateState()

    runs the state logic and sets state based on the current state values

    Declaration
    protected virtual void UpdateState()

    Implements

    IMixedRealityFocusChangedHandler
    IMixedRealityFocusHandler
    IMixedRealityInputHandler
    IMixedRealitySpeechHandler
    IMixedRealityTouchHandler
    IMixedRealityInputHandler<>
    IMixedRealityInputHandler<>
    IMixedRealityInputHandler<>
    Back to top Generated by DocFX