void Awake() { // Detect whether this platform is a supported platform RuntimePlatform currPlatform = Application.platform; SupportedPlatform |= currPlatform == RuntimePlatform.Android; SupportedPlatform |= currPlatform == RuntimePlatform.LinuxPlayer; SupportedPlatform |= currPlatform == RuntimePlatform.OSXEditor; SupportedPlatform |= currPlatform == RuntimePlatform.OSXPlayer; SupportedPlatform |= currPlatform == RuntimePlatform.WindowsEditor; SupportedPlatform |= currPlatform == RuntimePlatform.WindowsPlayer; if (!SupportedPlatform) { Debug.LogWarning("This platform is unsupported"); return; } if (HMD != null) { return; } HMD = Hmd.GetHmd(); SetLowPersistenceMode(true); }
IEnumerator CallbackCoroutine() { OVRDevice.HMD = Hmd.GetHmd(); while (true) { #if UNITY_EDITOR_WIN || (!UNITY_EDITOR_OSX && UNITY_STANDALONE_OSX) yield return(new WaitForEndOfFrame()); #else yield return(null); #endif OnCoroutine(); } }
void Awake() { string[] args = System.Environment.GetCommandLineArgs(); for (int i = 0; i < args.Length; ++i) { if (args[i] == "-fullscreen") { Debug.Log("Going to Full-Screen"); Screen.fullScreen = true; } else if (args[i] == "-window") { Debug.Log("Going to Window"); Screen.fullScreen = false; } } // Detect whether this platform is a supported platform RuntimePlatform currPlatform = Application.platform; SupportedPlatform |= currPlatform == RuntimePlatform.Android; SupportedPlatform |= currPlatform == RuntimePlatform.LinuxPlayer; SupportedPlatform |= currPlatform == RuntimePlatform.OSXEditor; SupportedPlatform |= currPlatform == RuntimePlatform.OSXPlayer; SupportedPlatform |= currPlatform == RuntimePlatform.WindowsEditor; SupportedPlatform |= currPlatform == RuntimePlatform.WindowsPlayer; if (!SupportedPlatform) { Debug.LogWarning("This platform is unsupported"); return; } if (HMD != null) { return; } HMD = Hmd.GetHmd(); //HACK: Forcing LP off until service initializes it properly. SetLowPersistenceMode(true); }