Exemple #1
0
 private void OnDestroy()
 {
     if (this == Instance)
     {
         Instance = null;
     }
 }
Exemple #2
0
 private void CreateInstance()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
 }