Immerseum SDK: VR Simulator (version: RC-1.0.0)
       [view as Desktop | Tablet | Mobile]
OnXAxisMovementEnd Event
Example 

If default InputActions are enabled, then this event fires whenever the user's avatar has completed its movement along the X-Axis. This event is invoked via the EventManager.endXAxisMovement method, which is itself called at the conclusion of the primary OnXAxisMovementStart listener.

Best Practice

If you have many separate listeners all listening for a particular OnXAxisMovementStart, it may be easy to lose track of which listener should invoke EventManager.endXAxisMovement.

As a general rule of thumb, this event should be invoked by the "main" method that deals with the x-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 endXAxisMovement method will be called and the OnXAxisMovementEnd event fired when the user's movement initiated by OnXAxisMovementStart has finished.

Syntax
public event EventManager.XAxisMovementEndAction OnXAxisMovementEnd
Example
public class myClass : MonoBehaviour {
    void OnEnable() {
        EventManager.OnXAxisMovementEnd += myCustomListener;
    }
    
    void OnDisable() {
        EventManager.OnXAxisMovementEnd -= myCustomListener;
    }
    
    void myCustomListener(InputAction action) {
        // Custom listener logic goes here.
    }
}
See Also

Reference

EventManager Class
EventManager Members

 

 


Copyright (c) 2016-2017 Immerseum Inc. All rights reserved.

Send Feedback