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