Immerseum.VRSimulator Namespace > EventManager Class : OnZAxisMovementEnd Event |
If default InputActions are enabled, then this event fires whenever the user's avatar has completed its movement along the Z-Axis. This event is invoked via the EventManager.endZAxisMovement method, which is itself called at the conclusion of the primary OnZAxisMovementStart listener.
Best Practice | |
If you have many separate listeners all listening for a particular OnZAxisMovementStart, it may be easy to lose track of which listener should invoke EventManager.endZAxisMovement. As a general rule of thumb, this event should be invoked by the "main" method that deals with the z-axis movement. "Main" in your case may be the method that does the most, or the method that takes the longest, or the method that deals directly with the user's avatar. Assuming default Input Actions are enabled, then the endZAxisMovement method will be called and the OnZAxisMovementEnd event fired when the user's movement initiated by OnZAxisMovementStart has finished. |
public event EventManager.ZAxisMovementEndAction OnZAxisMovementEnd
public class myClass : MonoBehaviour { void OnEnable() { EventManager.OnZAxisMovementEnd += myCustomListener; } void OnDisable() { EventManager.OnZAxisMovementEnd -= myCustomListener; } void myCustomListener(InputAction action) { // Custom listener logic goes here. } }