/// <summary> /// 点击登陆 /// </summary> public void OnBtnLoginClick() { SoundManager.Instance.PlayEffectMusic(Paths.UI_CLICK); if (!string.IsNullOrEmpty(InputUsername.text) && !string.IsNullOrEmpty(InputPassword.text)) { if (!PhotonEngine.Instance.IsConnect) { TipPanel.SetContent("服务器连接失败。。"); UIManager.Instance.PushPanel(UIPanelType.Tip); return; } m_LoginRequest.SendLoginRequest(InputUsername.text, InputPassword.text); ResetPanel(); UIManager.Instance.PushPanel(UIPanelType.Mask); } else { TextPrompt.text = "用户名或密码不能为空"; } }
/// <summary> /// 获取请求添加好友的响应 /// </summary> /// <param name="response"></param> public void OnAddRequest(OperationResponse response) { if ((ReturnCode)response.ReturnCode == ReturnCode.Falied) { TipPanel.SetContent(response.DebugMessage); UIManager.Instance.PushPanel(UIPanelType.Tip); } }
/// <summary> /// 注册响应 /// </summary> /// <param name="response"></param> public void OnRegisterResponse(OperationResponse response) { // 关闭遮罩界面 UIManager.Instance.PopPanel(); if ((ReturnCode)response.ReturnCode == ReturnCode.Suceess) { TipPanel.SetContent("注册成功", () => UIManager.Instance.PopPanel()); UIManager.Instance.PushPanel(UIPanelType.Tip); } else if ((ReturnCode)response.ReturnCode == ReturnCode.Falied) { TipPanel.SetContent(response.DebugMessage); UIManager.Instance.PushPanel(UIPanelType.Tip); } }
/// <summary> /// 登陆响应 /// </summary> /// <param name="response"></param> public void OnLoginResponse(OperationResponse response) { // 关闭遮罩界面 UIManager.Instance.PopPanel(); if ((ReturnCode)response.ReturnCode == ReturnCode.Suceess) { // 登陆音效 SoundManager.Instance.PlayEffectMusic(Paths.UI_ENTERGAME); UIManager.Instance.PushPanel(UIPanelType.MainMenu); } else { TipPanel.SetContent(response.DebugMessage); UIManager.Instance.PushPanel(UIPanelType.Tip); } }
/// <summary> /// 匹配完成 进入选择界面 /// </summary> public void OnMatchComplete(OperationResponse response) { // 隐藏匹配界面 m_MatchPanel.HidePanel(); // 恢复按钮 SetMatchBtnActive(true); // 显示是否进入选人的提示界面 TipPanel.SetContent("点击进入选人界面\n" + ServerConfig.SelectRoomTimeOff + "秒后自动取消", () => { // 清除界面 UIManager.Instance.ClearStack(); // 打开选择界面 UIManager.Instance.PushPanel(UIPanelType.Select); }, ServerConfig.SelectRoomTimeOff); UIManager.Instance.PushPanel(UIPanelType.Tip); }
/// <summary> /// 获取是否存在玩家的信息 /// </summary> /// <param name="response"></param> public void OnGetInfoRequest(OperationResponse response) { if ((ReturnCode)response.ReturnCode == ReturnCode.Suceess) { // 存在角色 发送在线请求 m_OnlineRequest.SendRequest(); } else if ((ReturnCode)response.ReturnCode == ReturnCode.Empty) { // 打开创建角色的面板 UIManager.Instance.PushPanel(UIPanelType.CreatePlayer); } else if ((ReturnCode)response.ReturnCode == ReturnCode.Falied) { UIManager.Instance.PopPanel(); TipPanel.SetContent(response.DebugMessage); UIManager.Instance.PushPanel(UIPanelType.Tip); } }