public void StartWXLogin(WeiXinInfo info) { SetThirdLoginInfo("WX-" + info.openid, "123458", info.nickname, info.headimgurl, LoginType.WX); string sex = null; if (info.sex == "1") { sex = "男"; } else { sex = "女"; } string acc = SecurityUtils.AESEncrypt("WX-" + info.openid, kv[0], kv[1]); string pwd = SecurityUtils.AESEncrypt("123458", kv[0], kv[1]); //string[] msg = new string[] { "1", ((int)LoginType.WX).ToString(), acc, pwd, info.nickname, info.headimgurl, sex, Application.version }; LoginOperation loginOperation = new LoginOperation(); LoginDto loginDto = loginOperation.regist(info.openid, "123", "123", "123", "123", "123"); if (loginDto != null) { //登录成功 跳转场景 PlayerCache.loginInfo = loginDto; UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.Hall); } else { XUIMidMsg.QuickMsg("登录失败,请稍后再试!!!"); } }
private void BtnCloseOnClick() { UIManager.Instance.Clear(); //跳转大厅场景 XUIUtils.LoadSceneX((int)SceneType.Hall); AudioManager.Instance.PlayerBgAudio("loadingbg"); }
private void BtnWXLoginOnClick() { // AudioManager.Instance.PlaySound("button"); if (Application.platform == RuntimePlatform.WindowsEditor) { string acc = SecurityUtils.AESEncrypt("WX-o2xMF1vxkphDaUP88lkypIYwN14E", kv[0], kv[1]); string pwd = SecurityUtils.AESEncrypt("123458", kv[0], kv[1]); LoginOperation loginOperation = new LoginOperation(); LoginDto loginDto = loginOperation.regist(UnityEngine.Random.Range(1, 10000).ToString(), UnityEngine.Random.Range(1, 100000).ToString(), "123", "Default_" + UnityEngine.Random.Range(0, 7), "男", "123"); if (loginDto != null) { //SaveLoginInfo(); //登录成功 跳转场景 PlayerCache.loginInfo = loginDto; UIManager.Instance.Clear(); TcpSocketImpl.getInstance().init(); ClientTcpIoMessage ioMessage = new ClientTcpIoMessage(); ioMessage.methodName = ""; ioMessage.interfaceName = ""; List <object> list = new List <object>(2); list.Add(loginDto.uid); list.Add(loginDto.secretKey); ioMessage.args = JsonMapper.ToJson(list); TcpSocketImpl.getInstance().async(ioMessage, 1, -100); XUIUtils.LoadSceneX((int)SceneType.Hall); } } else { loginByWX.LoginByWX(); } }
/// <summary> /// 切换账号 调到登录界面 /// </summary> private void BtnSwitchaccounOnClick() { //string[] msg = new string[] { "10003" }; //NetGameRoom.Instance.write(msg); //PlayerCache.Dealloc(); PlayerCache.loginOut.loginOut(PlayerCache.loginInfo.uid, PlayerCache.loginInfo.secretKey); UIManager.Instance.Clear(); XUIUtils.LoadSceneX(1); }
/// <summary> /// 打开千王场 /// </summary> private void BtnCheatOnClick() { UIManager.Instance.Clear(); if (!isOpen) { XUIUtils.LoadSceneX((int)SceneType.Cheat); isOpen = true; } AudioManager.Instance.PlaySound("button"); }
/// <summary> /// 打开经典场 /// </summary> private void BtnPinSanZhangOnClick() { UIManager.Instance.Clear(); if (!isOpen) { XUIUtils.LoadSceneX(3); isOpen = true; } AudioManager.Instance.PlaySound("button"); }
public void UpdateUI(params object[] param) { SaveLoginInfo(); //if (PlayerCache.loginInfo.Account == null) //{ // XUIMidMsg.QuickMsg("登录失败,请稍后再试!!!"); // return; //} // NetGameRoom.Instance.init(); //登录成功 跳转场景 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.Hall); }
/// <summary> /// 打开骰子场 /// </summary> private void BtnDiceOnClick() { GameDiceHttpRoomOperation DiceHttpOperation = new GameDiceHttpRoomOperation(); DiceRoomInfiDto diceRoomInfiDto = DiceHttpOperation.enter(PlayerCache.loginInfo.uid); if (diceRoomInfiDto != null) { GameManager.Instance.diceRoomInfiDto = diceRoomInfiDto; UIManager.Instance.Clear(); if (!isOpen) { //切换场景 XUIUtils.LoadSceneX((int)SceneType.Dice); isOpen = true; } } AudioManager.Instance.PlaySound("button"); }
/// <summary> /// 打开万人场 /// </summary> private void BtnWanRenChangOnClick() { Game2HttpRoomOperation RoomOperation = new Game2HttpRoomOperation(); Game2PlayerRoomDto game2PlayerRoomDto = RoomOperation.enterRoom(PlayerCache.loginInfo.uid, ((int)SceneID.Wanren)); if (game2PlayerRoomDto != null) { GameManager.Instance.game2PlayerRoomDto = game2PlayerRoomDto; //切换场景 UIManager.Instance.Clear(); if (!isOpen) { XUIUtils.LoadSceneX((int)SceneType.WanRen); isOpen = true; } } AudioManager.Instance.PlaySound("button"); }
/// <summary> /// 点击领取奖励 /// </summary> /// <param name="j"></param> private void BtnGetAward(Button button) { AudioManager.Instance.PlaySound("button"); Text text = button.GetComponentInChildren <Text>(); if (text.text == "立即开始") { //开始任务,调到经典场 选择类型 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.ClassicZJH); } else if (text.text == "领取") { ItemListDto itemListDto = dbGiftBagOperation.receiveAward(PlayerCache.loginInfo.uid); if (itemListDto != null) { PlayerCache.SetWealthUpdate(itemListDto.items, true); text.text = "已领取"; } } }
//点击立即前往 private void BtnTaskBtnOnClick(int taskId) { AudioManager.Instance.PlaySound("button"); if (everyBtn[taskId].transform.GetChild(0).GetComponent <Text>().text == "立即前往") { switch (taskId) { case 11: // UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.ClassicZJH); break; case 12: //玩一局摇摇乐 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.Dice); break; case 13: //玩一局天天乐 string[] msg = new string[] { "1019", "1" }; NetGameRoom.Instance.write(msg); if (PlayerCache.TianTianLeObj == null) { PlayerCache.TianTianLeObj = UIManager.Instance.OpenUI(PathStr.UI_TianTianLePanel_Path, null); PlayerCache.TianTianLeObj.name = "TianTianLe"; PlayerCache.TianTianLeObj.transform.SetParent(canvas); PlayerCache.TianTianLeObj.transform.localScale = Vector3.one; PlayerCache.TianTianLeObj.transform.localPosition = Vector3.zero; PlayerCache.TianTianLeObj.GetComponent <RectTransform>().offsetMin = Vector2.zero; PlayerCache.TianTianLeObj.GetComponent <RectTransform>().offsetMax = Vector2.zero; } else { PlayerCache.TianTianLeObj.transform.SetParent(canvas); PlayerCache.TianTianLeObj.transform.localScale = Vector3.one; PlayerCache.TianTianLeObj.SetActive(true); } break; case 14: //万人场下一注 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.WanRen); break; case 15: //千王场换牌一次 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.Cheat); break; case 16: //每天第一次充值 GameObject go2 = UIManager.Instance.OpenUI(PathStr.UI_ShopPanel_Path, transform); go2.transform.localPosition = Vector3.zero; go2.GetComponent <RectTransform>().offsetMin = Vector2.zero; go2.GetComponent <RectTransform>().offsetMax = Vector2.zero; go2.GetComponent <UIShopPanel>().toggleqiehuan(ShopType.Dimand); break; case 17: //连续赢5局 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.ClassicZJH); break; case 18: //对战50局以上 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.ClassicZJH); break; case 19: //每日第一次拿到金花 //万人场下一注 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.WanRen); break; case 20: //每日第一次拿到顺金 //万人场下一注 UIManager.Instance.Clear(); XUIUtils.LoadSceneX((int)SceneType.WanRen); break; default: break; } } else if (everyBtn[taskId].transform.GetChild(0).GetComponent <Text>().text == "立即领取") { string[] msg = new string[] { "15", taskId.ToString(), PlayerCache.loginInfo.Uid.ToString() }; HttpFramework.Instance.HttpPost(msg); everyBtn[taskId].interactable = false; everyBtn[taskId].transform.GetChild(0).GetComponent <Text>().text = "已领取"; } }