void Awake() { // Grab the ZSCoreSingleton and verify that it is initialized. _coreSingleton = ZSCoreSingleton.Instance; // If the CurrentCamera is null, default to Camera.main. if (!this.IsCurrentCameraValid() && Camera.main != null) this.CurrentCamera = Camera.main.gameObject; // Initialization. this.Initialize(); this.InitializeStereoCameras(); this.CheckForUpdates(); // Temporarily re-enable the camera in case other MonoBehaviour scripts // want to reference Camera.main in their Awake() method. if (this.IsCurrentCameraValid()) this.CurrentCamera.camera.enabled = true; if (_coreSingleton.IsInitialized) { // Set the window size. zsup_setWindowSize(Screen.width, Screen.height); // Start the update coroutine. StartCoroutine("UpdateCoroutine"); } else { Debug.Log("Could not initialize zSpace. Please confirm required plugin DLLs are present."); } }
void OnApplicationQuit() { if (_isInitialized) { _isInitialized = false; zsup_shutdown(); } _instance = null; }