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