Example #1
0
 // Use this for initialization
 void Start()
 {
     adminUI = transform.Find("admin").GetComponent<AdminUI>();
     mainUI = transform.Find("menu").GetComponent<MainUI>();
     accountUI = transform.Find("account").GetComponent<AccountUI>();
     loginUI = transform.Find("login").GetComponent<LoginUI>();
     passwordUI = transform.Find("password").GetComponent<PasswordUI>();
     charactersUI = transform.Find("characters").GetComponent<CharactersUI>();
     characterUI = transform.Find("character").GetComponent<CharacterUI>();
     playerUI = transform.Find("player").GetComponent<PlayerUI>();
 }
    public void ShowLoginDialog()
    {
        AccountUI accountUI = FindObjectOfType <AccountUI> ();

        if (accountUI == null)
        {
            accountUI = Instantiate(Resources.Load("AccountPopup", typeof(AccountUI))) as AccountUI;
            accountUI.SwitchMode(AccountUI.AccountUIMode.Login);
        }
        else
        {
            // Account UI already exists, make sure it's shown
            accountUI.gameObject.SetActive(true);
        }
    }