// Use this for initialization
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
         Destroy(this);
     }
예제 #2
0
 void _MakeSingleInstance()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         //DontDestroyOnLoad(gameObject);
     }
 }