Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
 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);
     }
 }