| using System.Collections; | 
| using System.Collections.Generic; | 
| using UnityEngine; | 
| using UnityEngine.UI; | 
|   | 
| /// <summary> | 
| /// 积分招募 | 
| /// </summary> | 
| public class HeroCallScoreWin : UIBase | 
| { | 
|     [SerializeField] Button ruleBtn; | 
|     [SerializeField] Image sliderImg; | 
|     [SerializeField] Text scoreProcessText; | 
|     [SerializeField] Text tryLockText; | 
|     [SerializeField] Button call1Btn; | 
|   | 
|   | 
|   | 
|     protected override void InitComponent() | 
|     { | 
|         call1Btn.AddListener(SendHeroCall); | 
|         ruleBtn.AddListener(() => | 
|         { | 
|             UIManager.Instance.OpenWindow<HeroCallScoreRuleWin>(); | 
|         }); | 
|     } | 
|   | 
|   | 
|     protected override void OnPreOpen() | 
|     { | 
|         HappyXBModel.Instance.RefreshXBTypeInfoAct += Refresh; | 
|         Refresh(); | 
|     } | 
|   | 
|     protected override void OnPreClose() | 
|     { | 
|         HappyXBModel.Instance.RefreshXBTypeInfoAct -= Refresh; | 
|     } | 
|   | 
|   | 
|     public override void Refresh() | 
|     { | 
|         var funcSet = TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore); | 
|         scoreProcessText.text = UIHelper.GetMoneyCnt(51) + "/" + TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]; | 
|         sliderImg.fillAmount = (float)UIHelper.GetMoneyCnt(51) / TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]; | 
|         if (UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]) | 
|         { | 
|             scoreProcessText.color = UIHelper.GetUIColor(TextColType.LightWhite); | 
|         } | 
|         else | 
|         { | 
|             scoreProcessText.color = UIHelper.GetUIColor(TextColType.Red); | 
|         } | 
|         if (InvestModel.Instance.IsInvested(InvestModel.monthCardType)) | 
|         { | 
|             tryLockText.SetActive(false); | 
|             call1Btn.SetActive(true); | 
|         } | 
|         else | 
|         { | 
|             tryLockText.SetActive(true); | 
|             if (HappyXBModel.Instance.GetXBInfoByType((int)HappXBTitle.HeroCallScore).treasureCount == 0) | 
|             { | 
|                 tryLockText.text = Language.Get("heroCall4", 1); | 
|                 call1Btn.SetActive(true); | 
|             } | 
|             else | 
|             { | 
|                 tryLockText.text = Language.Get("heroCall4", 0); | 
|                 call1Btn.SetActive(false); | 
|             } | 
|              | 
|         } | 
|     } | 
|   | 
|   | 
|     void SendHeroCall() | 
|     { | 
|   | 
|         if (!InvestModel.Instance.IsInvested(InvestModel.monthCardType)) | 
|         { | 
|             //未买月卡体验1次 | 
|             if (HappyXBModel.Instance.GetXBInfoByType((int)HappXBTitle.HeroCallScore).treasureCount != 0) | 
|             { | 
|                 return; | 
|             } | 
|         } | 
|   | 
|         HeroUIManager.Instance.selectCallType = HappXBTitle.HeroCallScore; | 
|         HeroUIManager.Instance.selectCallIndex = 0; | 
|   | 
|         HappyXBModel.Instance.SendOneXBQuest((int)HappXBTitle.HeroCallScore); | 
|     } | 
|   | 
| } |