/// <summary> /// 支付成功 /// </summary> private void BtnSuccessOnClcik() { UIHallManager uIHall = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHall != null) { uIHall.UpdateUI(); } UIZJHPanel uIZJHPanel = MessageManager.GetInstance.GetUIDict <UIZJHPanel>(); if (uIZJHPanel == null) { uIZJHPanel = MessageManager.GetInstance.GetUIDict <CheatZjhPanel>(); } if (uIZJHPanel != null) { uIZJHPanel.UpdateSelfUIInfo(); } //if (liuliu.UIWanRenChang != null) //{ // liuliu.UIWanRenChang.MiddleWeath(); //} //if (Diceliuliu.UIDicePlane != null) //{ // Diceliuliu.UIDicePlane.MiddleWeath(); //} AliPay.Instance.payStatus = false; AliPay.Instance.ClosePay(); Destroy(transform.gameObject); }
/// <summary> /// 收到消息 /// </summary> /// <param name="sendUid"></param> /// <param name="msg"></param> public override void receiveChatMsg(long sendUid, ChatDto chatDto) { if (chatDto != null) { if (PlayerCache.PrivateMsgDic.ContainsKey(chatDto.uid)) { PlayerCache.PrivateMsgDic[chatDto.uid].Add(chatDto); } else { List <ChatDto> list = new List <ChatDto>(); list.Add(chatDto); PlayerCache.PrivateMsgDic.Add(chatDto.uid, list); } if (PlayerCache.CurrentPrivateUid == chatDto.uid) { GameObject go = GameObject.Find("ChatWithFriendPanel(Clone)"); if (go != null) { //直接显示在聊天面板 go.GetComponent <ChatWithFriendPanel>().ReceiveMsg(chatDto); } } else { //弹出提示 if (!PlayerCache.privateMsgTips.Contains(chatDto.uid)) { Transform canvas = GameObject.Find("Canvas").transform; Transform msgTips = canvas.Find("PrivateMsgTips"); if (msgTips == null) { GameObject go = GameTools.Instance.GetObject("Prefabs/Tips/PrivateMsgTips"); GameObject obj = GameObject.Instantiate(go); obj.transform.SetParent(canvas); obj.name = chatDto.uid.ToString(); obj.transform.localScale = Vector3.one; msgTips = obj.transform; } UIHallManager uIHallManager = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHallManager != null) { msgTips.localPosition = Vector3.zero; } else { msgTips.localPosition = new Vector3(400, 200); } msgTips.SetAsLastSibling(); msgTips.localScale = new Vector3(0.5f, 0.5f, 0.5f); msgTips.DOScale(Vector3.one, 1f).SetLoops(-1, LoopType.Yoyo); PlayerCache.privateMsgTips.Add(chatDto.uid); } } } }
private void OnDisable() { //Transform resultParentTrans = transform.Find("Bg/Result"); //for (int i = 0; i < resultParentTrans.childCount; i++) //{ // Transform result = resultParentTrans.GetChild(i); // //单双 // result.GetChild(0).GetComponent<Text>().text = ""; // //牌型 // result.GetChild(1).GetComponent<Text>().text = ""; //} AudioManager.Instance.StopBgAudio(); UIHallManager uIHall = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHall != null) { if (uIHall.gameObject.activeSelf) { AudioManager.Instance.PlayerBgAudio("loadingbg"); } } UIZJHPanel uIZJHPanel = MessageManager.GetInstance.GetUIDict <UIZJHPanel>(); if (uIZJHPanel == null) { uIZJHPanel = MessageManager.GetInstance.GetUIDict <CheatZjhPanel>(); } if (uIZJHPanel != null) { if (uIZJHPanel.gameObject.activeSelf) { AudioManager.Instance.PlayerBgAudio("bgm3"); } } UIWanRenChang uIWanRenChang = MessageManager.GetInstance.GetUIDict <UIWanRenChang>(); if (uIWanRenChang != null) { if (uIWanRenChang.gameObject.activeSelf) { AudioManager.Instance.PlayerBgAudio("WanRenBG"); } } //UIDicePlane uIDicePlane = MessageManager.GetInstance.GetUIDict<UIDicePlane>(); //if (uIDicePlane != null) //{ // if (uIDicePlane.gameObject.activeSelf) // { // AudioManager.Instance.PlayerBgAudio("DiceBG"); // } //} }
/// <summary> /// 更新财富显示 /// </summary> public static void WealthUpdate() { UIHallManager uIHallManager = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHallManager != null) { uIHallManager.UpdateUI(); } //UIVipPanel uiVipMsg = MessageManager.GetInstance.GetUIDict<UIVipPanel>(); //如果是在vip特权这个界面,就立即更新vip经验值 //if (uiVipMsg != null) //{ // if (uiVipMsg.gameObject.activeSelf) // { // uiVipMsg.UpdateUI(); // } //} UIZJHPanel uIZJHPanel = MessageManager.GetInstance.GetUIDict <UIZJHPanel>(); if (uIZJHPanel == null) { uIZJHPanel = MessageManager.GetInstance.GetUIDict <CheatZjhPanel>(); } if (uIZJHPanel != null) { uIZJHPanel.UpdateSelfUIInfo(); } UIWanRenChang uIWanRenChang = MessageManager.GetInstance.GetUIDict <UIWanRenChang>(); if (uIWanRenChang != null) { uIWanRenChang.MiddleWeath(); } UIDicePlane uIDicePlane = MessageManager.GetInstance.GetUIDict <UIDicePlane>(); if (uIDicePlane != null) { uIDicePlane.MiddleWeath(); } UIShopPanel shopuiMessage = MessageManager.GetInstance.GetUIDict <UIShopPanel>(); if (shopuiMessage != null) { if (shopuiMessage.gameObject.activeSelf) { shopuiMessage.UpdateUIData(); } } }
public override void bet2CallBack(LotteryBetDto callBackParam) { if (callBackParam != null) { PlayerCache.loginInfo.gold = callBackParam.reduceGold; UIHallManager uIHallManager = MessageManager.GetInstance.GetUIDict <UIHallManager>(); UITianTianLePanel uITianTianLePanel = MessageManager.GetInstance.GetUIDict <UITianTianLePanel>(); if (uITianTianLePanel != null) { uITianTianLePanel.UpdateBetNum(callBackParam.betPosition, (int)(callBackParam.betGold / 200000)); } PlayerCache.WealthUpdate(); } }
public void UpdateUI(MoneyTreeOpenDto moneyTreeOpenDto) { if (moneyTreeOpenDto.lv == 0) { level.text = "0"; goldcount.text = "0"; slider.value = 0f; timer.text = "未获得摇钱树"; btn_Harvest.gameObject.SetActive(false); } else { level.text = NumberConvert.NunberToChar(moneyTreeOpenDto.lv); timer.text = moneyTreeOpenDto.timer.ToString() + "小时/12小时"; slider.value = moneyTreeOpenDto.timer * 1.0f / 12; goldcount.text = moneyTreeOpenDto.goldNum.ToString(); PlayerCache.loginInfo.gold = moneyTreeOpenDto.holdGold; btn_Harvest.gameObject.SetActive(true); } totalGold.text = PlayerCache.loginInfo.gold.ToString(); UIHallManager uIHallManager = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHallManager != null) { if (uIHallManager.gameObject.activeSelf) { uIHallManager.UpdateUI(); } } if (PlayerCache.loginInfo != null) { totalGold.text = PlayerCache.loginInfo.gold.ToString(); } }
/// <summary> /// 领取推广奖励 /// </summary> /// <param name="callBackParam"></param> public override void receiveAward2CallBack(GoldBaseDto callBackParam) { PlayerCache.loginInfo.gold = callBackParam.holdGold; UIHallManager uIHallManager = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHallManager != null) { if (uIHallManager.gameObject.activeSelf) { uIHallManager.UpdateUI(); } } UIStartEarnGoldPanel uIStartEarnGoldPanel = MessageManager.GetInstance.GetUIDict <UIStartEarnGoldPanel>(); if (uIStartEarnGoldPanel != null) { if (uIStartEarnGoldPanel.gameObject.activeSelf) { uIStartEarnGoldPanel.GetEarningsResponse(); } } XUIMidMsg.QuickMsg("领取" + callBackParam.exchangeGold + "金币成功!"); }
/// <summary> /// 填写邀请码 领取回调 /// </summary> /// <param name="callBackParam"></param> public override void invite2CallBack(GeneralizeAwardDto callBackParam) { PlayerCache.loginInfo.gold = callBackParam.selfHoldGold; // PlayerCache.loginInfo.HasGeneralizeId = true; UIHallManager uIHallManager = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHallManager != null) { if (uIHallManager.gameObject.activeSelf) { uIHallManager.UpdateUI(); } } UIInputInviteCodePanel uIInputInviteCodePanel = MessageManager.GetInstance.GetUIDict <UIInputInviteCodePanel>(); if (uIInputInviteCodePanel != null) { if (uIInputInviteCodePanel.gameObject.activeSelf) { uIInputInviteCodePanel.GetAwardSuccessResponse(); } } }
/// <summary> /// 响应服务器发送成功 /// </summary> public void SendSuccessResponse() { if (GlobalMsg.gameObject.activeSelf) { //发送到全服 switch (currentMsgType) { case MsgType.Text: GameObject go = Resources.Load <GameObject>("Prefabs/Msg/SelfChatMsg"); GameObject obj = Instantiate(go); obj.transform.SetParent(GlobalMsg.GetChild(0).GetChild(0)); LoadHeadImgUtils.Instance.LoadHeadImg(obj.transform.GetChild(0).GetComponent <Image>(), PlayerCache.loginInfo.headImgUrl); obj.transform.GetChild(1).GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/Vip/VipAtlas1", "new_rank_vip" + PlayerCache.loginInfo.vipLv); obj.transform.GetChild(2).GetComponent <Text>().text = PlayerCache.loginInfo.userName; obj.transform.GetChild(3).GetChild(0).GetComponent <Text>().text = currentMsg; obj.transform.GetChild(3).GetChild(0).GetComponent <Text>().color = currentColor; obj.transform.localScale = Vector3.one; Vector3 old = GlobalScrollbar.transform.GetChild(0).GetChild(0).localPosition; GlobalScrollbar.transform.GetChild(0).GetChild(0).transform.localPosition = new Vector3(old.x, old.y + 100); ChatDto chatDto = new ChatDto(); chatDto.username = PlayerCache.loginInfo.userName; chatDto.msg = currentMsg; chatDto.msgType = (int)MsgType.Text; //chatDto.BroadcatType = (int)BroadcatType.Global; PlayerCache.newBroadcastMsg = chatDto; input.text = ""; break; case MsgType.Expression: //发送到全服 GameObject go1 = Resources.Load <GameObject>("Prefabs/Msg/SelfEmojiMsg"); GameObject obj1 = Instantiate(go1); obj1.transform.SetParent(GlobalMsg.GetChild(0).GetChild(0)); obj1.transform.localScale = Vector3.one; LoadHeadImgUtils.Instance.LoadHeadImg(obj1.transform.GetChild(0).GetComponent <Image>(), PlayerCache.loginInfo.headImgUrl); obj1.transform.GetChild(1).GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/Vip/VipAtlas1", "new_rank_vip" + PlayerCache.loginInfo.vipLv); obj1.transform.GetChild(2).GetComponent <Text>().text = PlayerCache.loginInfo.userName; obj1.transform.GetChild(3).GetChild(0).GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/Expression/emojis/emoji", "emoji_" + currentMsg); Vector3 old1 = GlobalScrollbar.transform.GetChild(0).GetChild(0).localPosition; GlobalScrollbar.transform.GetChild(0).GetChild(0).transform.localPosition = new Vector3(old1.x, old1.y + 100); ChatDto chatDto1 = new ChatDto(); chatDto1.username = PlayerCache.loginInfo.userName; chatDto1.msg = "[emoji_" + currentMsg + "]"; chatDto1.msgType = (int)MsgType.Expression; //chatDto1.BroadcatType = (int)BroadcatType.Global; PlayerCache.newBroadcastMsg = chatDto1; break; default: break; } UIHallManager uIHall = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHall != null) { if (uIHall.gameObject.activeSelf) { uIHall.ShowNewMsg(PlayerCache.newBroadcastMsg); } } UIZJHPanel uIZJHPanel = MessageManager.GetInstance.GetUIDict <UIZJHPanel>(); if (uIZJHPanel == null) { uIZJHPanel = MessageManager.GetInstance.GetUIDict <CheatZjhPanel>(); } if (uIZJHPanel != null) { if (uIZJHPanel.gameObject.activeSelf) { uIZJHPanel.ShowBroadcastMsg(PlayerCache.newBroadcastMsg); } } //UIDicePlane uIDicePlane = MessageManager.GetInstance.GetUIDict<UIDicePlane>(); //if (uIDicePlane != null) //{ // uIDicePlane.ShowNewMsg(PlayerCache.newBroadcastMsg); //} //UIWanRenChang uIWanRenChang = MessageManager.GetInstance.GetUIDict<UIWanRenChang>(); //if (uIWanRenChang != null) //{ // uIWanRenChang.ShowNewMsg(PlayerCache.newBroadcastMsg); //} currentMsg = null; } if (FamilyMsg.gameObject.activeSelf) { //发送到家族 switch (currentMsgType) { case MsgType.Text: GameObject go = Resources.Load <GameObject>("Prefabs/Msg/SelfChatMsg"); GameObject obj = Instantiate(go); obj.transform.SetParent(FamilyMsg.GetChild(0).GetChild(0)); LoadHeadImgUtils.Instance.LoadHeadImg(obj.transform.GetChild(0).GetComponent <Image>(), PlayerCache.loginInfo.headImgUrl); obj.transform.GetChild(1).GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/Vip/VipAtlas1", "new_rank_vip" + PlayerCache.loginInfo.vipLv); obj.transform.GetChild(2).GetComponent <Text>().text = PlayerCache.loginInfo.userName; obj.transform.GetChild(3).GetChild(0).GetComponent <Text>().text = currentMsg; obj.transform.localScale = Vector3.one; FamilyScrollbar.verticalNormalizedPosition = 0; break; case MsgType.Expression: GameObject go1 = Resources.Load <GameObject>("Prefabs/Msg/SelfEmojiMsg"); GameObject obj1 = Instantiate(go1); obj1.transform.SetParent(FamilyMsg.GetChild(0).GetChild(0)); LoadHeadImgUtils.Instance.LoadHeadImg(obj1.transform.GetChild(0).GetComponent <Image>(), PlayerCache.loginInfo.headImgUrl); obj1.transform.GetChild(1).GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/Vip/VipAtlas1", "new_rank_vip" + PlayerCache.loginInfo.vipLv); obj1.transform.GetChild(2).GetComponent <Text>().text = PlayerCache.loginInfo.userName; obj1.transform.GetChild(3).GetChild(0).GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/Expression/emojis/emoji", "emoji_" + currentMsg); obj1.transform.localScale = Vector3.one; FamilyScrollbar.verticalNormalizedPosition = 0; break; default: break; } currentMsg = null; } }