コード例 #1
0
    public override void Execute(INotification notification)
    {
        Debug.Log("StartUpCommand: hello!");
        LoginPanelView loginPanelView = GameObject.Find("LoginPanel").GetComponent <LoginPanelView>();

        Facade.RegisterMediator(new LoginPanelMediator(loginPanelView));
    }
コード例 #2
0
ファイル: LoginPanel.cs プロジェクト: song-GAO-1992/gameDemo
    public override void OnInit()
    {
        if (!isPushedOnce)
        {
            Login_BT = transform.Find("LogIn_BT").GetComponent <Button>();
            Login_BT.onClick.AddListener(OnLoginClicked);
            Regist_BT = transform.Find("Regist_BT").GetComponent <Button>();
            Regist_BT.onClick.AddListener(OnRegistClicked);
            Quit_BT = transform.Find("LogInQuit_BT").GetComponent <Button>();
            Quit_BT.onClick.AddListener(OnQuitClicked);

            name_IF     = transform.Find("Name_IF").GetComponent <InputField>();
            password_IF = transform.Find("PSW_IF").GetComponent <InputField>();

            message    = transform.Find("Message").GetComponent <Text>();
            message_CG = transform.Find("Message").GetComponent <CanvasGroup>();


            canvasGroup  = GetComponent <CanvasGroup>();
            isPushedOnce = true;
            targetAlpha  = 0;
            //获取LoginPanelView组件
            loginPanelView = GetComponent <LoginPanelView>();
        }
    }
コード例 #3
0
 private void DisplayView(LoginPanelView view)
 {
     if (view == LoginPanelView.Login)
     {
     }
     else if (view == LoginPanelView.Logined)
     {
     }
 }
コード例 #4
0
 private void DisplayView(LoginPanelView view)
 {
     if (view == LoginPanelView.Login)
     {
         hplForgotPass.NavigateUrl = Common.GenerateUrl("resetpass");
         hplRegister.NavigateUrl   = Common.GenerateUrl("register");
         divLogin.Visible          = true;
         divLogined.Visible        = false;
     }
     else if (view == LoginPanelView.Logined)
     {
         hplUserPage.NavigateUrl = Common.GenerateUrl("personal");
         hplLogout.NavigateUrl   = Common.GenerateUrl("logout", "returnurl=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery));
         divLogin.Visible        = false;
         divLogined.Visible      = true;
     }
 }
コード例 #5
0
 // Use this for initialization
 public void init()
 {
     loginPanelObject  = transform.Find(GlobalName.LoginPanel).gameObject;
     selectPanelObject = transform.Find(GlobalName.SelectCharPanel).gameObject;
     if ((loginView = loginPanelObject.GetComponent <LoginPanelView>()) == null)
     {
         loginView = loginPanelObject.AddComponent <LoginPanelView>();
     }
     loginView.Init(loginPanelObject);
     selectCharView = selectPanelObject.AddComponent <SelectCharView>();
     selectCharView.Init(selectPanelObject);
     studentPanelObject = transform.Find(GlobalName.StudentPanel).gameObject;
     teacherPanelObject = transform.Find(GlobalName.TeacherPanel).gameObject;
     StudentPanel       = studentPanelObject.AddComponent <ControlPanelView>();
     StudentPanel.Init(studentPanelObject);
     TeacherPanel = teacherPanelObject.AddComponent <ControlPanelView>();
     TeacherPanel.Init(teacherPanelObject);
 }
コード例 #6
0
    private IEnumerator requestLogin(string url, Dictionary <string, string> postData)
    {
        LoginPanelView loginRoot = contextView.GetComponentInChildren <LoginPanelView>();

        using (UnityWebRequest www = UnityWebRequest.Post(CommenValue.HttpAddress + url, postData))
        {
            yield return(www.SendWebRequest());

            if (www.error != null)
            {
                LogTool.Log(www.error);
                loginRoot.loginStateChangedSignal.Dispatch(LoginState.LoginFailed);
            }
            else
            {
                if (www.responseCode == 200)
                {
                    fulfillSignal.Dispatch(www.downloadHandler.text);
                    loginRoot.loginStateChangedSignal.Dispatch(LoginState.isLogined);
                }
            }
        }
    }