示例#1
0
    public void ChangeState(LoginStates state)
    {
        Debug.Log(string.Format("Changing State to: {0}", state.ToString()));
        switch (state)
        {
        case LoginStates.Manual:
            manualLogin.EnableUI();
            autoLogin.DisableUI();
            registerLogin.DisableUI();
            break;

        case LoginStates.Register:
            manualLogin.DisableUI();
            autoLogin.DisableUI();
            registerLogin.EnableUI();
            break;

        case LoginStates.Auto:
            manualLogin.DisableUI();
            autoLogin.EnableUI();
            registerLogin.DisableUI();
            break;

        case LoginStates.LoggedIn:
            manualLogin.DisableUI();
            autoLogin.DisableUI();
            registerLogin.DisableUI();
            bottomMenu.DisableUI();
            this.GetComponent <Image>().enabled = false;
            break;
        }

        this.previousFrameState = this.activeState;

        if (LoginStateChange != null)
        {
            LoginStateChange(state);
        }
    }