Esempio n. 1
0
        public virtual void Start()
        {
            if (AllowLogin)
            {
                LoginPanel[] panels = Resources.FindObjectsOfTypeAll <LoginPanel>();
                if (panels.Length > 0)
                {
                    _loginPanel = panels[0]; // Assume only one type of this object exists.

                    if (!ConnectionMgr.Instance.IsLoggedIn)
                    {
                        if (ShowLogin)
                        {
                            Debug.Log("Showing login panel");
                            _loginPanel.Show();
                        }
                    }
                    else
                    {
                        _loginPanel.Hide();

                        UpdateAccountInfo(ConnectionMgr.Instance.CurrentAccount);
                    }
                }
                else
                {
                    Debug.LogError("Missing valid LoginPanel prefab in this scene!");
                }
            }

            if (AllowOptions)
            {
                OptionsPanel[] panels = Resources.FindObjectsOfTypeAll <OptionsPanel>();
                if (panels.Length > 0)
                {
                    _optionsPanel = panels[0]; // Assume only one type of this object exists.
                    _optionsPanel.Hide();
                }
                else
                {
                    Debug.LogError("Missing valid OptionPanel prefab in this scene!");
                }
            }

            if (ShowHideTransition)
            {
                if (_transitionPanel != null)
                {
                    _transitionPanel.Hide();
                }
            }
        }
Esempio n. 2
0
 public void HideOptions()
 {
     optionsPanel.Hide();
 }