Beispiel #1
0
 private void Awake()
 {
     if (Instacne == null)
     {
         Instacne = this;
     }
     else
     {
         Debug.LogError("more than one instance");
     }
 }
Beispiel #2
0
 private void Awake()
 {
     DontDestroyOnLoad(gameObject);
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Debug.LogError("more than one instance");
     }
 }