API reference
API reference
Select your platform
No SDKs available
No versions available

ActiveStateUnityEventWrapper Class

Extends MonoBehaviour
The ActiveStateUnityEventWrapper class provides a way to link Unity events with the state of an IActiveState.
This class is designed to trigger Unity events based on changes in the active state, allowing developers to easily connect Interaction SDK logic with Unity's built-in event system.
This class is particularly useful for triggering visual or audio effects, or other Unity-based events in response to changes in an interaction's active state.

Fields

WhenActivated : UnityEvent
The Unity event that is triggered during an Update when the provided IActiveState becomes active.
Signature
UnityEvent Oculus.Interaction.ActiveStateUnityEventWrapper.WhenActivated
WhenDeactivated : UnityEvent
The Unity event that is triggered during an Update when the provided IActiveState becomes inactive.
Signature
UnityEvent Oculus.Interaction.ActiveStateUnityEventWrapper.WhenDeactivated

Protected Methods

Awake ()
Signature
virtual void Oculus.Interaction.ActiveStateUnityEventWrapper.Awake()
Returns
void
Start ()
Signature
virtual void Oculus.Interaction.ActiveStateUnityEventWrapper.Start()
Returns
void
Update ()
This update method monitors the active state and triggers the appropriate Unity event based on the current state.
Signature
virtual void Oculus.Interaction.ActiveStateUnityEventWrapper.Update()
Returns
void

Methods

InjectActiveState ( activeState )
Sets the active state for the wrapper.
This method is designed to support dependency injection for unit testing.
Signature
void Oculus.Interaction.ActiveStateUnityEventWrapper.InjectActiveState(IActiveState activeState)
Parameters
activeState: IActiveState  The active state to set
Returns
void
InjectAllActiveStateUnityEventWrapper ( activeState )
Injects an active state that this ActiveStateUnityEventWrapper will monitor.
This method is used to set up the wrapper with the active state whose changes will trigger the associated Unity events.
Signature
void Oculus.Interaction.ActiveStateUnityEventWrapper.InjectAllActiveStateUnityEventWrapper(IActiveState activeState)
Parameters
activeState: IActiveState  The IActiveState instance that will be monitored.
Returns
void
InjectOptionalEmitOnFirstUpdate ( emitOnFirstUpdate )
Optionally sets whether to emit events on the first update.
Signature
void Oculus.Interaction.ActiveStateUnityEventWrapper.InjectOptionalEmitOnFirstUpdate(bool emitOnFirstUpdate)
Parameters
emitOnFirstUpdate: bool  If true, events will be emitted on the first update.
Returns
void
InjectOptionalWhenActivated ( whenActivated )
Injects a Unity event that is triggered when the active state is activated.
Signature
void Oculus.Interaction.ActiveStateUnityEventWrapper.InjectOptionalWhenActivated(UnityEvent whenActivated)
Parameters
whenActivated: UnityEvent  The Unity event to trigger on activation.
Returns
void
InjectOptionalWhenDeactivated ( whenDeactivated )
Injects a Unity event that is triggered when the active state is deactivated.
Signature
void Oculus.Interaction.ActiveStateUnityEventWrapper.InjectOptionalWhenDeactivated(UnityEvent whenDeactivated)
Parameters
whenDeactivated: UnityEvent  The Unity event to trigger on deactivation.
Returns
void