Пример #1
0
    public void OnRandomButtonClick()
    {
        GameRoot.PlayEffect(Consts.A_ButtonClick);
        var rdname = GameRoot.Instance.resourceService.GetRandomName(true);

        iptName.text = rdname;
    }
Пример #2
0
 public void OnEnterGameClick()
 {
     GameRoot.PlayEffect(Consts.A_ButtonClick);
     if (iptName.text == "" || iptName.text == null)
     {
         GameRoot.AddTips("请输入合法名称");
     }
     //发送请求;
     else
     {
         netService.SendMessages(new GameMessage()
         {
             cmd           = (int)CMD.RenameRequest,
             renameRequest = new RenameRequest()
             {
                 name = iptName.text
             }
         });
     }
 }
Пример #3
0
    public void OnEnterClick()
    {
        //GameRoot.Instance.audioService.PlayEffect(Consts.A_Login);
        GameRoot.PlayEffect(Consts.A_Login);
        //保存玩家输入
        var account  = m_AccountField.text;
        var password = m_PasswordField.text;

        //对输入进行判断
        if (account != "" && password != "")
        {
            //保存
            PlayerPrefs.SetString(Consts.SavingAccount, account);
            PlayerPrefs.SetString(Consts.SavingPassword, password);

            //发送网络请求
            GameMessage message = new GameMessage
            {
                cmd          = (int)CMD.LoginRequest,
                loginRequest = new LoginRequest()
                {
                    Account  = account,
                    Password = password
                }
            };
            netService.SendMessages(message);
            //切换场景
            // LoginSystem.Instance.ReqLogin();
        }
        else
        {
            GameRoot.AddTips("账号或密码为空");
        }

        //进入游戏
    }
Пример #4
0
 public void OnNoticeClick()
 {
     GameRoot.PlayEffect(Consts.A_ButtonClick);
 }