void Awake()
 {
     if (_instance != null) {
         DestroyImmediate (gameObject);
     } else {
         DontDestroyOnLoad (gameObject);
         _instance = this;
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (_instance != null)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         _instance = this;
     }
 }