void Awake() { // switching level won't destroy JSEngine // but we'd like to destroy manually if (JSEngine.inst != null) { Destroy(JSEngine.inst.gameObject); } if (SampleViewer.inst != null) { Destroy(gameObject); } else { inst = this; DontDestroyOnLoad(gameObject); } }
void Awake() { // switching level won't destroy JSEngine // but we'd like to destroy manually if (JSEngine.inst != null) { Destroy(JSEngine.inst.gameObject); } if (SampleViewer.inst != null) { Destroy(gameObject); } else { inst = this; DontDestroyOnLoad(gameObject); } }