Пример #1
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         duplicated = true;
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
         initialize();
     }
 }
Пример #2
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }

        setupButtons();         // locate the buttons
        GUIScreenLayoutManager.Instance.register(this);
        TransitionGUIFxManager.Instance.register(this, false);
    }