interface MAGES::IControllerInteractor¶
Overview¶
Interface for Controller based Interactors. More…
interface IControllerInteractor: public MAGES::IInteractor { // properties AudioSource SoundSource; AudioClip HoverEnterSound; AudioClip SelectEnterSound; AudioClip ActivateEnterSound; float UIHoverEnterHapticIntensity; float HoverEnterHapticIntensity; float SelectEnterHapticIntensity; float ActivateEnterHapticIntensity; 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; InteractionLayer InteractionLayer; 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; IInteractable ManualSelectionInteractable; float SelectionIntensity; bool IsActivateEnabled; bool HasActivation; IInteractable ActivatedInteractable; float ActivationIntensity; // methods bool CanHover(IInteractable interactable); bool IsHovering(IInteractable interactable); bool HoverExit(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); bool SelectExit(IInteractable interactable); void OnSelectEnter(SelectEnterInteractionEventArgs args); void OnSelectEntered(SelectEnterInteractionEventArgs args); void OnSelectExit(SelectExitInteractionEventArgs args); void OnSelectExited(SelectExitInteractionEventArgs args); void StartManualSelection(IInteractable interactable); void StopManualSelection(); bool CanActivate(IInteractable interactable); bool IsActivating(IInteractable interactable); bool ActivateExit(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 SelectEnterSound
Gets or sets the sound to be played when the interactor starts selecting.
AudioClip ActivateEnterSound
Gets or sets the sound to be played when the interactor starts activating.
float UIHoverEnterHapticIntensity
Gets or sets the haptic feedback strength when the interactor starts hovering over a UI.
float HoverEnterHapticIntensity
Gets or sets the haptic feedback strength when the interactor starts hovering.
float SelectEnterHapticIntensity
Gets or sets the haptic feedback strength when the interactor starts selecting.
float ActivateEnterHapticIntensity
Gets or sets the haptic feedback strength when the interactor starts 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.