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

The Unity event that is triggered during an Update when the provided IActiveState becomes active.
The Unity event that is triggered during an Update when the provided IActiveState becomes inactive.

Protected Functions

virtual void Awake ( )
virtual void Start ( )
This update method monitors the active state and triggers the appropriate Unity event based on the current state.

Member Functions

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.
Parameters
activeState
The IActiveState instance that will be monitored.
Sets the active state for the wrapper.
This method is designed to support dependency injection for unit testing.
Parameters
activeState
The active state to set
Optionally sets whether to emit events on the first update.
Parameters
emitOnFirstUpdate
If true, events will be emitted on the first update.
Injects a Unity event that is triggered when the active state is activated.
Parameters
whenActivated
The Unity event to trigger on activation.
Injects a Unity event that is triggered when the active state is deactivated.
Parameters
whenDeactivated
The Unity event to trigger on deactivation.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon