Пример #1
0
 private void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Пример #2
0
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.LogWarning("LayerDict already in scene! Deleting myself!");
         Destroy(this);
         return;
     }
     Instance = this;
 }