public static void OnGetLoginBonusRes(GetLoginBonusRes ret) { if (ret.errcode == 0) { if (ret != null) { RewardStruct reward = new RewardStruct(ret); EquipConfig config = EquipConfig.GetEquipByID(ret.id); if (config.IsMoney()) { PlayerManager.player_data.money += ret.num; } List <RewardStruct> list = new List <RewardStruct>(); list.Add(reward); LoginBonusRewardPanel.Show(list); if (LoginBonusPanel.Instance != null) { LoginBonusPanel.Instance.UpdatePanel(ret.bonusdata); } } } else { string ErrTips = ErrCodeConfig.GetTipsById(ret.errcode); PopItem item = UIManager.AddItem <PopItem>("PopItem", UIManager.PopPanelRoot); if (!string.IsNullOrEmpty(ErrTips)) { item.SetTips(ErrTips); } } }
public void SetInfo(LoginBonusData data) { EquipConfig eqt = EquipConfig.GetEquipByID(data.id); signtype = (LoginSignType)data.status; switch (data.status) { case (int)LoginSignType.WaitSign: Sign_text.text = "待签到"; break; case (int)LoginSignType.CanSign: Sign_text.text = "可签到"; break; case (int)LoginSignType.AgainSign: Sign_text.text = "可补签"; break; case (int)LoginSignType.AlreadySign: Sign_text.text = "已领取"; break; } DayIndex = data.day; Bonus_text.text = data.num + eqt.equipname; Day_text.text = "第" + data.day + "天"; Bonus_Image.sprite = ResManager.GetResource <Sprite>(eqt.resname); Image_mask.gameObject.SetActive(data.status == 3); }