예제 #1
0
 private void Awake()
 {
     if (!current)
     {
         current = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (current != this)
     {
         Destroy(gameObject);
     }
 }
예제 #2
0
 private void OnDestroy()
 {
     current = null;
 }