public void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
private void Awake() { // if the singleton hasn't been initialized yet if (instance != null && instance != this) { Destroy(this.gameObject); return; } // GvrViewer.Instance.AutoDriftCorrection = false; // GvrViewer.Instance.autoUntiltHead = false; instance = this; DontDestroyOnLoad(this.gameObject); }