using System.Collections; using System.Collections.Generic; using System.Dynamic; using UnityEngine; using UnityEngine.UI; public class MailTwoPanel : BasePanel { //关闭 public Button btnClose; //礼物按钮 public Button btnReward; //领取按钮 public Button btnGet; //游戏文字 public Text txtReward; private MailInfo mailInfo; //点击领取后,要更新已领取面板 private GameObject go; public override void Init() { btnClose.onClick.AddListener(() => { UIManager.Instance.HidePanel(false); }); btnGet.onClick.AddListener(() => { GameDataMgr.Instance.player.gold += mailInfo.mailData.gold; StartCoroutine(NetMgr.Instance.ChangeDataPost(GameDataMgr.Instance.player)); go.SetActive(true); UIManager.Instance.GetPanel().UpdateGold(); UIManager.Instance.GetPanel().ClaimMail(mailInfo.mailData.id); UIManager.Instance.HidePanel(false); }); } public void UpedatePanel(MailInfo info,GameObject obj) { go = obj; mailInfo = info; txtReward.text = "亲爱的玩家您好,恭喜您在本周的荣耀排行榜中获\n得排名第"+info.mailData.rank+"的成绩!\n现在为您发放对应的排名奖励,请查收!"; } }