예제 #1
0
        /// <inheritdoc />
        public override void Initialize(Transform playerRoot, VusrEventSystem eventSystem)
        {
            _oculusGazeInputModule = eventSystem.gameObject.AddComponent <GazeInputModule>();
            _inputProvider         = new OculusGazeInput();

            if (VusrInput.CurrentVRDevice == VRDeviceMask.OculusAndroid)
            {
                _inputProvider.ControlType = OVRInput.Controller.Touchpad;
            }
            else if (VusrInput.CurrentVRDevice == VRDeviceMask.OculusWindows)
            {
                _inputProvider.ControlType = OVRInput.Controller.Remote;
            }

            _oculusGazeInputModule.SetGazeProvider(_inputProvider);

            _onFocusLost   = () => { VusrInput.VrFocusChanged(true); };
            _onFocusGained = () => { VusrInput.VrFocusChanged(false); };

            OVRManager.VrFocusLost     += _onFocusLost;
            OVRManager.VrFocusAcquired += _onFocusGained;
        }
예제 #2
0
 /// <summary>
 /// Callback sent to all game objects when the player pauses.
 /// </summary>
 /// <param name="pauseStatus">The pause state of the application.</param>
 protected virtual void OnApplicationPause(bool pauseStatus)
 {
     VusrInput.VrFocusChanged(pauseStatus);
 }