示例#1
0
        public void ReadState(ControllerState outState)
        {
#if UNITY_HAS_GOOGLEVR
            if (InstantPreview.Instance != null &&
                InstantPreview.Instance.IsCurrentlyConnected &&
                !EmulatorManager.Instance.Connected)
            {
                // Uses Instant Preview to get controller state if connected.
                instantPreviewControllerProvider.ReadState(outState);
                return;
            }
#endif // UNITY_HAS_GOOGLEVR

            // If Instant Preview is not connected, tries to use the emulator or
            // mouse.
            emulatorControllerProvider.ReadState(emulatorState);
            mouseControllerProvider.ReadState(mouseState);

            // Defaults to mouse state if the emulator isn't available.
            if (emulatorState.connectionState != GvrConnectionState.Connected &&
                mouseState.connectionState == GvrConnectionState.Connected)
            {
                outState.CopyFrom(mouseState);
            }
            else
            {
                outState.CopyFrom(emulatorState);
            }
        }
 public void ReadState(ControllerState outState)
 {
     outState.CopyFrom(dummyState);
 }