/// @cond HIDDEN public override void OnInspectorGUI() { GUI.changed = false; GUIStyle headingStyle = new GUIStyle(GUI.skin.label); headingStyle.fontStyle = FontStyle.Bold; NvrViewer nvrViewer = (NvrViewer)target; EditorGUILayout.LabelField("General Settings", headingStyle); nvrViewer.VRModeEnabled = EditorGUILayout.Toggle(vrModeLabel, nvrViewer.VRModeEnabled); nvrViewer.LockHeadTracker = EditorGUILayout.Toggle(vrLockHeadTracker, nvrViewer.LockHeadTracker); nvrViewer.DistortionEnabled = EditorGUILayout.Toggle(distortionEnabledLabel, nvrViewer.DistortionEnabled); nvrViewer.TextureQuality = (TextureQuality)EditorGUILayout.EnumPopup(qualityLabel, nvrViewer.TextureQuality); nvrViewer.DirectRender = EditorGUILayout.Toggle(directRenderEnabledLabel, nvrViewer.DirectRender); if (GUI.changed) { EditorUtility.SetDirty(nvrViewer); } //EditorGUILayout.LabelField(editorSettingsLabel, headingStyle); //gvrViewer.autoUntiltHead = // EditorGUILayout.Toggle(autoUntiltHeadLabel, gvrViewer.autoUntiltHead); //gvrViewer.ScreenSize = (NvrProfile.ScreenSizes) // EditorGUILayout.EnumPopup(screenSizeLabel, gvrViewer.ScreenSize); //gvrViewer.ViewerType = (NvrProfile.ViewerTypes) // EditorGUILayout.EnumPopup(viewerTypeLabel, gvrViewer.ViewerType); }
/// @note Each scene load causes an OnDestroy of the current SDK, followed /// by and Awake of a new one. That should not cause the underlying native /// code to hiccup. Exception: developer may call Application.DontDestroyOnLoad /// on the SDK if they want it to survive across scene loads. void Awake() { if (instance == null) { instance = this; // we sync in the TimeWarp, so we don't want unity syncing elsewhere QualitySettings.vSyncCount = 0; Application.runInBackground = false; Input.gyro.enabled = false; Application.targetFrameRate = 60; // Disable screen dimming Screen.sleepTimeout = SleepTimeout.NeverSleep; } if (instance != this) { Debug.LogError("There must be only one NvrViewer object in a scene."); UnityEngine.Object.DestroyImmediate(this); return; } InitDevice(); AddPrePostRenderStages(); device.AndroidLog("Welcome to use Unity NVR SDK , current SDK VERSION is " + NVR_SDK_VERSION + ", j " + NvrGlobal.jarVersion + ", s " + NvrGlobal.soVersion + ", u " + Application.unityVersion); }
void OnDestroy() { if (btnLiseners != null) { btnLiseners.Clear(); } btnLiseners = null; RealeaseEyeStereoScreens(); VRModeEnabled = false; if (device != null) { device.Destroy(); } if (instance == this) { instance = null; } Debug.Log("NvrViewer->OnDestroy"); }
void Awake() { NvrViewer.Create(); }
void Awake() { NvrViewer.Create(); cam = GetComponent <Camera>(); AddStereoRig(); }