Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     if (instance != null && instance != this) {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }