Immerseum SDK: VR Simulator (version: BETA-0.9)
       [view as Desktop | Tablet | Mobile]
OnPitchRotationEnd Event
Example 

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

Best Practice

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

As a general rule of thumb, this event should be invoked by the "main" method that deals with the pitch 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 camera.

Assuming default Input Actions are enabled, then the endPitchRotation method will be called and the OnPitchRotationEnd event fired when the camera rotation initiated by OnPitchRotationStart has finished.

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

Reference

EventManager Class
EventManager Members

 

 


Copyright (c) 2015 Immerseum Inc. All rights reserved.

Send Feedback