예제 #1
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
         SingletonLoader.CheckSingleton();
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
예제 #2
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(MainObject);
         anim = GetComponent <Animator>();
         SingletonLoader.CheckSingleton();
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }