| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | |
| | | [SerializeField] Text call10Text; |
| | | [SerializeField] Button okBtn; |
| | | |
| | | [SerializeField] Text callTip; |
| | | |
| | | int resultState = 0; //0单抽展示 1十连展示 2 十连开始展示 3 十连立绘展示 |
| | | public enum ResultState |
| | | { |
| | | single = 0, //单抽展示 |
| | | singleStart = 1, //单抽展示开始 |
| | | ten = 2, //十连展示 |
| | | tenStart = 3, //十连开始展示 |
| | | Lihui = 4, //立绘展示 |
| | | } |
| | | ResultState resultState = ResultState.single; |
| | | |
| | | bool isSkip = false; |
| | | List<int> showLHHeroIDList = new List<int>(); |
| | |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct -= RefreshBtn; |
| | | } |
| | | |
| | | |
| | | void UpdateState() |
| | | { |
| | | if (HeroUIManager.Instance.selectCallIndex == 0) |
| | | if (isSkip) |
| | | { |
| | | resultState = 0; |
| | | } |
| | | else if (isSkip) |
| | | { |
| | | resultState = 1; |
| | | resultState = HeroUIManager.Instance.selectCallIndex == 0 ? ResultState.single : ResultState.ten; |
| | | |
| | | RefreshState(); |
| | | } |
| | | else |
| | | { |
| | | resultState = 2; |
| | | resultState = HeroUIManager.Instance.selectCallIndex == 0 ? ResultState.singleStart : ResultState.tenStart; |
| | | RefreshState(); |
| | | MoveToNextState().Forget(); |
| | | } |
| | | RefreshState(); |
| | | } |
| | | |
| | | async UniTask MoveToNextState() |
| | | { |
| | | await UniTask.Delay(1500); |
| | | |
| | | showLHHeroIDList.Clear(); |
| | | for (int i = 0; i < HappyXBModel.Instance.xbResultDict.Count; i++) |
| | | { |
| | | var heroID = HappyXBModel.Instance.xbResultDict[i].itemId; |
| | | if (HeroConfig.Get(heroID).Quality >= 4) |
| | | if (HeroConfig.Get(heroID).Quality >= HappyXBModel.Instance.lhQuality) |
| | | showLHHeroIDList.Add(HappyXBModel.Instance.xbResultDict[i].itemId); |
| | | } |
| | | |
| | | resultState = 3; |
| | | await UniTask.Delay(resultState == ResultState.singleStart ? 800 : 1500); |
| | | |
| | | resultState = ResultState.Lihui; |
| | | try |
| | | { |
| | | RefreshState(); |
| | |
| | | |
| | | void RefreshState() |
| | | { |
| | | if (resultState == 0) |
| | | if (resultState == ResultState.single) |
| | | { |
| | | btnsObj.SetActive(true); |
| | | call1Btn.SetActive(HeroUIManager.Instance.selectCallType != HappXBTitle.HeroCallScore ? true : false); |
| | | call10Btn.SetActive(false); |
| | | callTip.SetActive(true); |
| | | |
| | | result1Obj.SetActive(true); |
| | | result10Obj.SetActive(false); |
| | |
| | | ShowMoney(true); |
| | | heroInfoObj.SetActive(true); |
| | | |
| | | result1Cell.Display(HappyXBModel.Instance.xbResultDict[0].itemId, 0); |
| | | if (isSkip) |
| | | result1Cell.Display(HappyXBModel.Instance.xbResultDict[0].itemId, 0, true); |
| | | RefreshHeroInfo(HappyXBModel.Instance.xbResultDict[0].itemId); |
| | | RefreshLuck(); |
| | | |
| | | } |
| | | else if (resultState == 1) |
| | | else if (resultState == ResultState.singleStart) |
| | | { |
| | | btnsObj.SetActive(false); |
| | | callTip.SetActive(false); |
| | | |
| | | result1Obj.SetActive(true); |
| | | result10Obj.SetActive(false); |
| | | result10LihuiObj.SetActive(false); |
| | | ShowMoney(false); |
| | | heroInfoObj.SetActive(false); |
| | | |
| | | result1Cell.Display(HappyXBModel.Instance.xbResultDict[0].itemId, 0); |
| | | RefreshLuck(); |
| | | } |
| | | else if (resultState == ResultState.ten) |
| | | { |
| | | btnsObj.SetActive(true); |
| | | call1Btn.SetActive(false); |
| | | call10Btn.SetActive(true); |
| | | callTip.SetActive(true); |
| | | |
| | | result1Obj.SetActive(false); |
| | | result10Obj.SetActive(true); |
| | |
| | | heroInfoObj.SetActive(false); |
| | | if (isSkip) |
| | | Refresh10Result(); |
| | | |
| | | } |
| | | else if (resultState == 2) |
| | | else if (resultState == ResultState.tenStart) |
| | | { |
| | | btnsObj.SetActive(false); |
| | | callTip.SetActive(false); |
| | | |
| | | result1Obj.SetActive(false); |
| | | result10Obj.SetActive(true); |
| | |
| | | heroInfoObj.SetActive(false); |
| | | Refresh10Result(); |
| | | } |
| | | else if (resultState == 3) |
| | | else if (resultState == ResultState.Lihui) |
| | | { |
| | | btnsObj.SetActive(false); |
| | | |
| | | callTip.SetActive(false); |
| | | result1Obj.SetActive(false); |
| | | result10Obj.SetActive(false); |
| | | result10LihuiObj.SetActive(true); |
| | |
| | | |
| | | call10ItemIcon.SetOrgSprite(IconKey); |
| | | call10Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[1] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[1].ToString())); |
| | | |
| | | RefreshLuck(); |
| | | } |
| | | |
| | | void ShowMoney(bool show) |
| | |
| | | } |
| | | else |
| | | { |
| | | resultState = 1; |
| | | resultState = HeroUIManager.Instance.selectCallIndex == 0 ? ResultState.single : ResultState.ten; |
| | | RefreshState(); |
| | | return; |
| | | } |
| | |
| | | heroJobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class)); |
| | | jobPosNameText.text = HeroUIManager.Instance.GetJobName(heroConfig.Class) + " " + heroConfig.Desc; |
| | | } |
| | | |
| | | |
| | | void RefreshLuck() |
| | | { |
| | | //再招募{0}次后必得{1}武将 |
| | | List<int> qualityList = new List<int>(); |
| | | var needCount = HappyXBModel.Instance.GetNextXBCountForBigAward((int)HappXBTitle.HeroCallAdvanced, out qualityList); |
| | | List<string> qualityStrList = new List<string>(); |
| | | for (int i = 0; i < qualityList.Count; i++) |
| | | { |
| | | qualityStrList.Add(UIHelper.AppendColor(qualityList[i], Language.Get("equipQualityFormat", Language.Get("CommonQuality" + qualityList[i])))); |
| | | } |
| | | callTip.text = Language.Get("HeroCall6", needCount, string.Join(Language.Get("L1130"), qualityStrList.ToArray())); |
| | | } |
| | | } |