interface MAGES::IControllerInteractor¶
Overview¶
Interface for Controller based Interactors. More…
interface IControllerInteractor: public MAGES::IInteractor { // properties AudioSource SoundSource; AudioClip HoverEnterSound; AudioClip HoverExitSound; AudioClip SelectEnterSound; AudioClip SelectExitSound; AudioClip ActivateEnterSound; AudioClip ActivateExitSound; float HoverEnterHapticIntensity; float HoverExitHapticIntensity; float SelectEnterHapticIntensity; float SelectExitHapticIntensity; float ActivateEnterHapticIntensity; float ActivateExitHapticIntensity; bool IsSelectInputEnabled; bool WasSelectInputEnabledThisFrame; bool WasSelectInputDisabledThisFrame; bool IsActivateInputEnabled; bool WasActivateInputEnabledThisFrame; bool WasActivateInputDisabledThisFrame; bool IsUISelectInputEnabled; bool WasUISelectInputEnabledThisFrame; bool WasUISelectInputDisabledThisFrame; // methods bool PlayHaptics(float intensity, float duration); }; // direct descendants class BaseControllerInteractor;
Inherited Members¶
public: // properties IInteractionManager InteractionManager; Transform Transform; Rigidbody Rigidbody; ListColliders; UnityEvent<InteractorRegisterEventArgs> RegisterEntered; UnityEvent<InteractorDeregisterEventArgs> DeregisterEntered; UnityEvent<HoverEnterInteractionEventArgs> HoverEntered; UnityEvent<HoverExitInteractionEventArgs> HoverExited; UnityEvent<SelectEnterInteractionEventArgs> SelectEntered; UnityEvent<SelectExitInteractionEventArgs> SelectExited; UnityEvent<ActivateEnterInteractionEventArgs> ActivateEntered; UnityEvent<ActivateExitInteractionEventArgs> ActivateExited; bool IsHoverEnabled; bool HasHover; IInteractable HoveredInteractable; bool IsSelectEnabled; bool HasSelection; IInteractable SelectedInteractable; float SelectionIntensity; bool IsActivateEnabled; bool HasActivation; IInteractable ActivatedInteractable; float ActivationIntensity; // methods bool CanHover(IInteractable interactable); bool IsHovering(IInteractable interactable); void OnHoverEnter(HoverEnterInteractionEventArgs args); void OnHoverEntered(HoverEnterInteractionEventArgs args); void OnHoverExit(HoverExitInteractionEventArgs args); void OnHoverExited(HoverExitInteractionEventArgs args); bool CanSelect(IInteractable interactable); bool IsSelecting(IInteractable interactable); void OnSelectEnter(SelectEnterInteractionEventArgs args); void OnSelectEntered(SelectEnterInteractionEventArgs args); void OnSelectExit(SelectExitInteractionEventArgs args); void OnSelectExited(SelectExitInteractionEventArgs args); bool CanActivate(IInteractable interactable); bool IsActivating(IInteractable interactable); void OnActivateEnter(ActivateEnterInteractionEventArgs args); void OnActivateEntered(ActivateEnterInteractionEventArgs args); void OnActivateExit(ActivateExitInteractionEventArgs args); void OnActivateExited(ActivateExitInteractionEventArgs args); void OnRegisterEnter(InteractorRegisterEventArgs args); void OnRegisterEntered(InteractorRegisterEventArgs args); void OnDeregisterEnter(InteractorDeregisterEventArgs args); void OnDeregisterEntered(InteractorDeregisterEventArgs args); void GetValidTargets(List<IInteractable> result); void PreprocessInteractor(UpdatePhase updatePhase); void ProcessInteractor(UpdatePhase updatePhase);
Detailed Documentation¶
Interface for Controller based Interactors.
Such interactors are the ones controlled using a physical devices. For example a Hand Interactor that is controlled by a handheld controller.
These interactors can play sound, have haptics and get analog Selection/Activation intensity values.
Properties¶
AudioSource SoundSource
Gets or sets the sound source to play sounds from.
AudioClip HoverEnterSound
Gets or sets the sound to be played when the interactor starts hovering.
AudioClip HoverExitSound
Gets or sets the sound to be played when the interactor stops hovering.
AudioClip SelectEnterSound
Gets or sets the sound to be played when the interactor starts selecting.
AudioClip SelectExitSound
Gets or sets the sound to be played when the interactor stops selecting.
AudioClip ActivateEnterSound
Gets or sets the sound to be played when the interactor starts activating.
AudioClip ActivateExitSound
Gets or sets the sound to be played when the interactor stops activating.
float HoverEnterHapticIntensity
Gets or sets the haptic feedback strength when the interactor starts hovering.
float HoverExitHapticIntensity
Gets or sets the haptic feedback strength when the interactor stops hovering.
float SelectEnterHapticIntensity
Gets or sets the haptic feedback strength when the interactor starts selecting.
float SelectExitHapticIntensity
Gets or sets the haptic feedback strength when the interactor stops selecting.
float ActivateEnterHapticIntensity
Gets or sets the haptic feedback strength when the interactor starts activating.
float ActivateExitHapticIntensity
Gets or sets the haptic feedback strength when the interactor stops activating.
bool IsSelectInputEnabled
Gets a value indicating whether the controller select button is pressed.
bool WasSelectInputEnabledThisFrame
Gets a value indicating whether the controller select button was pressed this frame.
bool WasSelectInputDisabledThisFrame
Gets a value indicating whether the controller select button was released this frame.
bool IsActivateInputEnabled
Gets a value indicating whether the controller activate button is pressed.
bool WasActivateInputEnabledThisFrame
Gets a value indicating whether the controller activate button was pressed this frame.
bool WasActivateInputDisabledThisFrame
Gets a value indicating whether the controller activate button was released this frame.
bool IsUISelectInputEnabled
Gets a value indicating whether the controller button that performs a UI selection is pressed.
bool WasUISelectInputEnabledThisFrame
Gets a value indicating whether the controller button that performs a UI selection was pressed this frame.
bool WasUISelectInputDisabledThisFrame
Gets a value indicating whether the controller button that performs a UI selection was released this frame.
Methods¶
bool PlayHaptics(float intensity, float duration)
Plays haptics on the controller, if it is supported.
Parameters:
intensity |
The intensity of the haptics. |
duration |
The duration of the haptics. |
Returns:
true
if haptics are supported and the operation was successful.