Exemplo n.º 1
0
 /// <summary>
 /// Awake is called when the script instance is being loaded.
 /// </summary>
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
 public override void Awake()
 {
     SharedInstance = this;
     base.Awake();
 }