Bewerken

Delen via


InteractiveElement Class

Definition

A simplified centralized entry point to the MRTK input system. Contains state management methods, event management and the state setting logic for some Core Interaction States.

public ref class InteractiveElement : Microsoft::MixedReality::Toolkit::Experimental::InteractiveElement::BaseInteractiveElement
public class InteractiveElement : Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.BaseInteractiveElement
type InteractiveElement = class
    inherit BaseInteractiveElement
Public Class InteractiveElement
Inherits BaseInteractiveElement
Inheritance
UnityEngine.MonoBehaviour
InteractiveElement

Constructors

InteractiveElement()

Fields

ClickedStateName (Inherited from BaseInteractiveElement)
DefaultStateName (Inherited from BaseInteractiveElement)
FocusFarStateName (Inherited from BaseInteractiveElement)
FocusNearStateName (Inherited from BaseInteractiveElement)
FocusStateName (Inherited from BaseInteractiveElement)
SelectFarStateName (Inherited from BaseInteractiveElement)
SpeechKeywordStateName (Inherited from BaseInteractiveElement)
ToggleOffStateName (Inherited from BaseInteractiveElement)
ToggleOnStateName (Inherited from BaseInteractiveElement)
TouchStateName (Inherited from BaseInteractiveElement)

Properties

Active

Whether or not this interactive element will react to input and update internally. If true, the object will react to input and update internally. If false, the object will not update internally and not react to input, i.e. state values will not be updated.

(Inherited from BaseInteractiveElement)
EventReceiverManager

Manages the associated state events contained in a state.

(Inherited from BaseInteractiveElement)
StateManager

Entry point for state management. Contains methods for state setting, getting and creating.

(Inherited from BaseInteractiveElement)
States

A list of the interaction states for this interactive element.

(Inherited from BaseInteractiveElement)

Methods

AddNewState(String)

Creates and adds a new state to track given the new state name.

(Inherited from BaseInteractiveElement)
AddNewStateWithEventConfiguration(String, BaseInteractionEventConfiguration)

Create and add a new state given the state name and the associated existing event configuration.

(Inherited from BaseInteractiveElement)
AddToggleStates()

Add the ToggleOn and ToggleOff state.

(Inherited from BaseInteractiveElement)
ForceSetToggleStates(Boolean)

Force set the toggle states either on or off.

(Inherited from BaseInteractiveElement)
GetState(String)

Gets a state by using the state name.

(Inherited from BaseInteractiveElement)
GetStateEvents<T>(String)

Get the events associated with a state given the type and the state name.

If the state to retrieve is a CoreInteractionState: The type name of a state's event configuration is the state name + "Events". For example, Touch state's event configuration is named TouchEvents. The Focus state's event configuration is named FocusEvents.

If the state is not a CoreInteractionState: The type is most likely StateEvents. The StateEvents type is the default type of a new state that is not a core state.

(Inherited from BaseInteractiveElement)
IsStateActive(String)

Check if a state is currently active.

(Inherited from BaseInteractiveElement)
IsStatePresent(String)

Checks if a state is currently in the States list and is being tracked by the state manager.

(Inherited from BaseInteractiveElement)
OnFocusEnter(FocusEventData) (Inherited from BaseInteractiveElement)
OnFocusExit(FocusEventData) (Inherited from BaseInteractiveElement)
OnPointerClicked(MixedRealityPointerEventData) (Inherited from BaseInteractiveElement)
OnPointerDown(MixedRealityPointerEventData) (Inherited from BaseInteractiveElement)
OnPointerDragged(MixedRealityPointerEventData) (Inherited from BaseInteractiveElement)
OnPointerUp(MixedRealityPointerEventData) (Inherited from BaseInteractiveElement)
OnSpeechKeywordRecognized(SpeechEventData) (Inherited from BaseInteractiveElement)
OnTouchCompleted(HandTrackingInputEventData) (Inherited from BaseInteractiveElement)
OnTouchStarted(HandTrackingInputEventData) (Inherited from BaseInteractiveElement)
OnTouchUpdated(HandTrackingInputEventData) (Inherited from BaseInteractiveElement)
OnValidate() (Inherited from BaseInteractiveElement)
RemoveState(String)

Removes a state. The state will no longer be tracked if it is removed.

(Inherited from BaseInteractiveElement)
ResetAllStates()

Reset all the state values in the list to 0. State values are reset when the Active property is set to false.

(Inherited from BaseInteractiveElement)
SetStateAndInvokeEvent(String, Int32, BaseEventData)

Sets a state to a given state value and invokes an event with associated event data.

(Inherited from BaseInteractiveElement)
SetStateOff(String)

Gets and sets a state to Off and invokes the OnStateDeactivated event. Setting a state off changes the state value to 0.

(Inherited from BaseInteractiveElement)
SetStateOn(String)

Gets and sets a state to On and invokes the OnStateActivated event. Setting a state on changes the state value to 1.

(Inherited from BaseInteractiveElement)
SetToggles(Boolean) (Inherited from BaseInteractiveElement)
SetToggleStates()

Set the toggle based on the current values of the ToggleOn and ToggleOff states.

(Inherited from BaseInteractiveElement)
Start() (Inherited from BaseInteractiveElement)
TriggerClickedState()

Set the Clicked state which triggers the OnClicked event. The click behavior in the state management system is expressed by setting the Clicked state to on and then immediately setting it to off.

Note: Due to the fact that a click is triggered by setting the Clicked state to on and then immediately off, the cyan active state highlight in the inspector will not be visible.

(Inherited from BaseInteractiveElement)

Applies to