public void OnEnterEquip(RewardTemplate thetemp) { GlobalWindowSoundController.Instance.PlayOpenSound(); Init(); var item = IconItem.GetComponent<SignItemControl>(); item.SetData(thetemp.Id, false, false); var lb = TitleLabel.GetComponent<UILabel>(); lb.text = item.Name; lb = AtkLabel.GetComponent<UILabel>(); lb.text = "攻击 [FFC300]" + GetValue(ItemModeLocator.Instance.GetAttack(thetemp.RewardTempId, 1)) + "[-]"; lb = HpLabel.GetComponent<UILabel>(); lb.text = "HP [FFC300]" + GetValue(ItemModeLocator.Instance.GetHp(thetemp.RewardTempId, 1)) + "[-]"; lb = QiliLabel.GetComponent<UILabel>(); lb.text = "气力 [FFC300]" + GetValue(ItemModeLocator.Instance.GetMp(thetemp.RewardTempId)) + "[-]"; lb = RecoverLabel.GetComponent<UILabel>(); lb.text = "回复 [FFC300]" + GetValue(ItemModeLocator.Instance.GetRecover(thetemp.RewardTempId, 1)) + "[-]"; lb = SkillTitleLabel.GetComponent<UILabel>(); lb.text = "装备技能"; lb = SkillLabel.GetComponent<UILabel>(); lb.text = ItemModeLocator.Instance.GetDesc(thetemp.RewardTempId); }
public void OnEnterHero(RewardTemplate thetemp) { GlobalWindowSoundController.Instance.PlayOpenSound(); Init(); var item = IconItem.GetComponent<SignItemControl>(); item.SetData(thetemp.Id, false, false); var tem = HeroModelLocator.Instance.GetHeroByTemplateId(thetemp.RewardTempId); var lb = TitleLabel.GetComponent<UILabel>(); lb.text = item.Name; lb = AtkLabel.GetComponent<UILabel>(); lb.text = "攻击 [FFC300]" + tem.Attack + "[-]"; lb = HpLabel.GetComponent<UILabel>(); lb.text = "HP [FFC300]" + tem.HP + "[-]"; lb = QiliLabel.GetComponent<UILabel>(); lb.text = "气力 [FFC300]" + tem.MP + "[-]"; lb = RecoverLabel.GetComponent<UILabel>(); lb.text = "回复 [FFC300]" + tem.Recover + "[-]"; var heroskilltemp = HeroModelLocator.Instance.GetLeaderSkillTemplateById(tem.LeaderSkill); if (tem.LeaderSkill <= 0 || heroskilltemp == null) { SkillTitleLabel.SetActive(false); SkillLabel.SetActive(false); } else { SkillTitleLabel.SetActive(true); SkillLabel.SetActive(true); lb = SkillTitleLabel.GetComponent<UILabel>(); lb.text = "武将技能"; lb = SkillLabel.GetComponent<UILabel>(); lb.text = heroskilltemp.Desc; } }
public void Read (TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Map) { { RewardTmpls = new Dictionary<int, RewardTemplate>(); TMap _map0 = iprot.ReadMapBegin(); for( int _i1 = 0; _i1 < _map0.Count; ++_i1) { int _key2; RewardTemplate _val3; _key2 = iprot.ReadI32(); _val3 = new RewardTemplate(); _val3.Read(iprot); RewardTmpls[_key2] = _val3; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
public int SetData(QusetMsgInfo theinfo, OnSelectedCallback selectfunc = null) { if (BgSprite == null) { BgSprite = transform.FindChild("Sprite bg").gameObject; TitleLabel = transform.FindChild("Label title").gameObject; GetLabel = transform.FindChild("Label gift").gameObject; RewardItem = transform.FindChild("SignItem").gameObject; GetButton = transform.FindChild("Button").gameObject; BtnBgScript = transform.FindChild("Button/Background").gameObject; BtnLabel = transform.FindChild("Button/Label").gameObject; ButtonUIEventListener = UIEventListener.Get(GetButton); ButtonUIEventListener.onClick += ClickBtnHandler; GotoUIEventListener = UIEventListener.Get(TitleLabel); GotoUIEventListener.onClick += GotoBtnHandler; } OnSelected = selectfunc; questInfo = theinfo; questTemp = SystemModelLocator.Instance.QuestTemplates.QuestTmpls[questInfo.Id]; var lb = TitleLabel.GetComponent<UILabel>(); lb.text = questTemp.Desc; //0未完成 1已完成未领取 2 已领取 if (questInfo.Status == 0) { BgSprite.SetActive(true); GetLabel.SetActive(true); RewardItem.SetActive(true); var item = RewardItem.GetComponent<SignItemControl>(); item.SetData(questTemp.RewardId, false, false, SelectHandler); RewardTemplate = item.RewardTemplate; GetButton.SetActive(false); return 0; } else if (questInfo.Status == 1) { BgSprite.SetActive(true); GetLabel.SetActive(false); RewardItem.SetActive(false); GetButton.SetActive(true); lb = BtnLabel.GetComponent<UILabel>(); lb.text = "领取"; lb.color = new Color(250,230,0); var btn = GetButton.GetComponent<UIButton>(); btn.enabled = true; BtnBgScript.SetActive(true); // var sp = BtnBgScript.GetComponent<UISprite>(); // sp.color = new Color(255, 255, 255); return 0; } else { BgSprite.SetActive(false); GetLabel.SetActive(false); RewardItem.SetActive(false); GetButton.SetActive(true); lb = BtnLabel.GetComponent<UILabel>(); lb.text = "已领取"; lb.color = new Color(100, 100, 100); var btn = GetButton.GetComponent<UIButton>(); btn.enabled = false; BtnBgScript.SetActive(false); return 1; } }
//奖励的id,是否已经签到,是否可以选择 public void SetData(int rewardid, bool havesign, bool canselect, OnSelectedCallback selectfunc = null) { RewardId = rewardid; HaveSign = havesign; CanSelect = canselect; OnSelected = selectfunc; Debug.Log("rewardid:" + rewardid); //PopTextManager.PopTip("rewardid:" + rewardid); RewardTemplate = SystemModelLocator.Instance.RewardTemplates.RewardTmpls[rewardid]; if (RewardTemplate.RewardType == SIGN_REWARD_TYPE_HERO) { var tem = HeroModelLocator.Instance.GetHeroByTemplateId(RewardTemplate.RewardTempId); Name = tem.Name; Count = 1; } else if (RewardTemplate.RewardType == SIGN_REWARD_TYPE_ITEM) { Name = ItemModeLocator.Instance.GetName(RewardTemplate.RewardTempId); Count = 1; } else { Name = MailConstant.GetCurrencyNameById(RewardTemplate.RewardTempId); Count = RewardTemplate.RewardCount; } SetContent(); }