private void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
 }
Пример #2
0
    void Awake()
    {
        if (masterSingleton != null && masterSingleton != this)
        {
            Destroy(this.gameObject);
            return;
        }

        masterSingleton = this;
        DontDestroyOnLoad(this.gameObject);
    }