System/ZhanLing/LoginZhanLingCell.cs
@@ -2,39 +2,51 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; using System; public class LoginZhanLingCell : CellView { [SerializeField] ImageEx imgUnlockLV; [SerializeField] ImageEx imgFreeHave; [SerializeField] ImageEx imgFreeLock; [SerializeField] TextEx txtUnlockLV; [SerializeField] ItemCell freeItemCell; [SerializeField] List<ItemCell> paidItemCellList = new List<ItemCell>(); [SerializeField] List<ImageEx> imgPaidHaveList = new List<ImageEx>(); [SerializeField] List<ImageEx> imgPaidLockList = new List<ImageEx>(); [SerializeField] List<ItemCell> paidItemCellHList = new List<ItemCell>(); [SerializeField] List<ImageEx> imgPaidHaveHList = new List<ImageEx>(); [SerializeField] List<ImageEx> imgPaidLockHList = new List<ImageEx>(); [SerializeField] ImageEx imgBrownProgressBar; [SerializeField] ImageEx imgGreenProgressBar; [SerializeField] ImageEx imgBG; [SerializeField] RotationTween freeItemCellTween; [SerializeField] List<RotationTween> paidItemCellTweenList = new List<RotationTween>(); LoginZhanLingModel loginZhanLingModel { get { return ModelCenter.Instance.GetModelEx<LoginZhanLingModel>(); } } [SerializeField] List<RotationTween> paidItemCellTweenHList = new List<RotationTween>(); VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } LoginZhanLingModel model { get { return ModelCenter.Instance.GetModel<LoginZhanLingModel>(); } } ZhanLingHBuyModel zhanLingHBuyModel { get { return ModelCenter.Instance.GetModel<ZhanLingHBuyModel>(); } } int curValue = 0; int zhanlingId; void OnEnable() { loginZhanLingModel.PlayAnimationSync += OnPlaySyncAnimation; model.PlayAnimationSync += OnPlaySyncAnimation; if (curValue == 0) return; int freeState = loginZhanLingModel.GetGiftState(5, curValue, true); int paidState = loginZhanLingModel.GetGiftState(5, curValue, false); int freeState = model.GetFreeGiftState(model.ZhanLingHType, curValue); int paidState = model.GetPaidGiftState(model.ZhanLingHType, curValue); int paidHState = model.GetPaidGiftHState(model.ZhanLingHType, curValue); freeItemCellTween.Stop(); freeItemCellTween.SetStartState(); for (int i = 0; i < paidItemCellTweenList.Count; i++) { paidItemCellTweenList[i].Stop(); paidItemCellTweenList[i].SetStartState(); } for (int i = 0; i < paidItemCellTweenHList.Count; i++) { paidItemCellTweenHList[i].Stop(); paidItemCellTweenHList[i].SetStartState(); } if (freeState == 1) { @@ -47,53 +59,61 @@ paidItemCellTweenList[i].Play(); } } if (paidHState == 1) { for (int i = 0; i < paidItemCellTweenHList.Count; i++) { paidItemCellTweenHList[i].Play(); } } } public void Display(int needValue) { curValue = needValue; int freeState = loginZhanLingModel.GetGiftState(5, needValue, true); int paidState = loginZhanLingModel.GetGiftState(5, needValue, false); imgFreeHave.SetActiveIL(freeState == 2); imgFreeLock.SetActiveIL(freeState == 0); imgGreenProgressBar.SetActiveIL(freeState != 0); int zhanlingId = ILZhanlingConfig.GetTypeToIDDict(model.ZhanLingHType)[needValue]; int freeState = this.model.GetFreeGiftState(model.ZhanLingHType, needValue); int paidState = this.model.GetPaidGiftState(model.ZhanLingHType, needValue); int paidHState = this.model.GetPaidGiftHState(model.ZhanLingHType, needValue); int buyState = this.model.GetBuyState(model.ZhanLingHType); DebugEx.Log($"needValue {needValue} freeState {freeState} paidState {paidState} paidHState {paidHState}"); imgFreeHave.SetActive(freeState == 2); imgGreenProgressBar.SetActive(freeState != 0); for (int i = 0; i < paidItemCellList.Count; i++) { imgPaidHaveList[i].SetActiveIL(paidState == 2); imgPaidLockList[i].SetActiveIL(paidState == 0); imgPaidHaveList[i].SetActive(paidState == 2); imgPaidLockList[i].SetActive(paidState == 0); } int days = loginZhanLingModel.GetDay(); if (days < needValue) for (int i = 0; i < paidItemCellHList.Count; i++) { imgUnlockLV.gray = true; imgPaidHaveHList[i].SetActive(paidHState == 2); imgPaidLockHList[i].SetActive(paidHState == 0); } else { imgUnlockLV.gray = false; } txtUnlockLV.text = Language.Get("SignIn_4", needValue); imgUnlockLV.gray = !this.model.IsNeedValueOk(needValue); txtUnlockLV.text = needValue.ToString(); txtUnlockLV.colorType = this.model.IsNeedValueOk(needValue) ? TextColType.NavyBrown : TextColType.White; //让第一个cell的进度条不凸出 if (ILZhanlingConfig.GetTypeToIDDict(5).Keys.ToList()[0] == needValue) if (ILZhanlingConfig.GetTypeToIDDict(model.ZhanLingHType).Keys.ToList()[0] == needValue) { imgBrownProgressBar.rectTransform.sizeDelta = new Vector2(imgBG.rectTransform.sizeDelta.x, imgBrownProgressBar.rectTransform.sizeDelta.y); imgGreenProgressBar.rectTransform.sizeDelta = new Vector2(imgBG.rectTransform.sizeDelta.x, imgGreenProgressBar.rectTransform.sizeDelta.y); } else { imgBrownProgressBar.rectTransform.sizeDelta = new Vector2(imgBG.rectTransform.sizeDelta.x + 10, imgBrownProgressBar.rectTransform.sizeDelta.y); imgGreenProgressBar.rectTransform.sizeDelta = new Vector2(imgBG.rectTransform.sizeDelta.x + 10, imgGreenProgressBar.rectTransform.sizeDelta.y); imgBrownProgressBar.rectTransform.sizeDelta = new Vector2(imgBG.rectTransform.sizeDelta.x + 30, imgBrownProgressBar.rectTransform.sizeDelta.y); imgGreenProgressBar.rectTransform.sizeDelta = new Vector2(imgBG.rectTransform.sizeDelta.x + 30, imgGreenProgressBar.rectTransform.sizeDelta.y); } //展示ItemCell var itemId = loginZhanLingModel.GetItemCellID(5, needValue, true); var model = new ItemCellModel(itemId, false, (ulong)loginZhanLingModel.GetItemCellCount(5, needValue, true)); freeItemCell.Init(model); var itemId = ILZhanlingConfig.Get(zhanlingId).FreeRewardItemList[0][0]; var model1 = new ItemCellModel(itemId, false, (ulong)ILZhanlingConfig.Get(zhanlingId).FreeRewardItemList[0][1]); freeItemCell.Init(model1); freeItemCell.button.SetListener(() => { if (freeState == 1) { loginZhanLingModel.HaveAllZhanLingGift(5); this.model.HaveAllZhanLingGift(model.ZhanLingHType); } else { @@ -103,28 +123,81 @@ for (int i = 0; i < paidItemCellList.Count; i++) { var itemId2 = loginZhanLingModel.GetItemCellID(5, needValue, false, i); var model2 = new ItemCellModel(itemId2, false, (ulong)loginZhanLingModel.GetItemCellCount(5, needValue, false, i)); var itemId2 = ILZhanlingConfig.Get(zhanlingId).ZLRewardItemList[i][0]; var model2 = new ItemCellModel(itemId2, false, (ulong)ILZhanlingConfig.Get(zhanlingId).ZLRewardItemList[i][1]); paidItemCellList[i].Init(model2); paidItemCellList[i].button.SetListener(() => { if (paidState == 1) //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 2) { loginZhanLingModel.HaveAllZhanLingGift(5); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG2"); } else { ItemTipUtility.Show(itemId2); if (paidState == 1) { this.model.HaveAllZhanLingGift(model.ZhanLingHType); } else { ItemTipUtility.Show(itemId2); } } }); } for (int i = 0; i < paidItemCellHList.Count; i++) { var itemId3 = ILZhanlingConfig.Get(zhanlingId).ZLRewardItemListH[i][0]; var model3 = new ItemCellModel(itemId3, false, (ulong)ILZhanlingConfig.Get(zhanlingId).ZLRewardItemListH[i][1]); paidItemCellHList[i].Init(model3); paidItemCellHList[i].button.SetListener(() => { //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 1) { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyBG2"); } else { if (paidHState == 1) { this.model.HaveAllZhanLingGift(model.ZhanLingHType); } else { ItemTipUtility.Show(itemId3); } } }); } //播放旋转动画 PlayAnimation(); } void OnDisable() { model.PlayAnimationSync -= OnPlaySyncAnimation; } //播放旋转动画 void PlayAnimation() { int freeState = model.GetFreeGiftState(model.ZhanLingHType, curValue); int paidState = model.GetPaidGiftState(model.ZhanLingHType, curValue); int paidHState = model.GetPaidGiftHState(model.ZhanLingHType, curValue); freeItemCellTween.Stop(); freeItemCellTween.SetStartState(); for (int i = 0; i < paidItemCellTweenList.Count; i++) { paidItemCellTweenList[i].Stop(); paidItemCellTweenList[i].SetStartState(); } for (int i = 0; i < paidItemCellTweenHList.Count; i++) { paidItemCellTweenHList[i].Stop(); paidItemCellTweenHList[i].SetStartState(); } if (freeItemCellTween.isActiveAndEnabled && freeState == 1) @@ -139,36 +212,18 @@ paidItemCellTweenList[i].Play(); } } } void OnDisable() { loginZhanLingModel.PlayAnimationSync -= OnPlaySyncAnimation; for (int i = 0; i < paidItemCellTweenHList.Count; i++) { if (paidItemCellTweenHList[i].isActiveAndEnabled && paidHState == 1) { paidItemCellTweenHList[i].Play(); } } } private void OnPlaySyncAnimation() { int freeState = loginZhanLingModel.GetGiftState(5, curValue, true); int paidState = loginZhanLingModel.GetGiftState(5, curValue, false); freeItemCellTween.Stop(); freeItemCellTween.SetStartState(); for (int i = 0; i < paidItemCellTweenList.Count; i++) { paidItemCellTweenList[i].Stop(); paidItemCellTweenList[i].SetStartState(); } if (freeItemCellTween.isActiveAndEnabled && freeState == 1) { freeItemCellTween.Play(); } for (int i = 0; i < paidItemCellTweenList.Count; i++) { if (paidItemCellTweenList[i].isActiveAndEnabled && paidState == 1) { paidItemCellTweenList[i].Play(); } } PlayAnimation(); } } System/ZhanLing/LoginZhanLingModel.cs
@@ -1,23 +1,23 @@ using vnxbqy.UI; using System.Collections.Generic; using System.Linq; using LitJson; using System; public class LoginZhanLingModel : Model, IBeforePlayerDataInitialize { public readonly int ZhanLingHType = 5; public readonly int FuncId = 233; //收益百分比 public string profitRatio; // 战令类型对应的充值ID列表 public Dictionary<int, int> ctgIdDict = new Dictionary<int, int>(); // 高级战令类型对应的充值ID列表 public Dictionary<int, List<int>> ctgIdDictH = new Dictionary<int, List<int>>(); public Dictionary<int, List<int>> ctgIdDict = new Dictionary<int, List<int>>(); //收到的所有服务器战令包字典 public Dictionary<int, ZhanlingInfo> zhanLingInfoDict = new Dictionary<int, ZhanlingInfo>(); //战令类型: 所需值 :key public Dictionary<int, Dictionary<int, int>> typeToIDListDict = new Dictionary<int, Dictionary<int, int>>(); public Action UpdateGiftStateEvent; public Redpoint redpoint = new Redpoint(MainRedPoint.RechargeGenerousGiftWinRedpoint, MainRedDot.LoginZhanLingRedpoint); List<ZhanLingGiftItemInfo> allGiftItemList = new List<ZhanLingGiftItemInfo>(); //同步播放摆动动画 public Action PlayAnimationSync; private bool isPlayAnimation = false; @@ -37,12 +37,16 @@ isPlayAnimation = false; } } GatheringSoulModel model { get { return ModelCenter.Instance.GetModel<GatheringSoulModel>(); } } PetHorseActModel petHorseActModel { get { return ModelCenter.Instance.GetModel<PetHorseActModel>(); } } public override void Init() { FuncOpen.Instance.OnFuncStateChangeEvent += OnFunctionStateChange; ctgIdDict = GeneralDefine.OldZhanLingCtgIdDict; profitRatio = GeneralDefine.ZhanLingProfitRatio[4].ToString(); typeToIDListDict = ILZhanlingConfig.GetAllTypeToIDListDict(); TimeMgr.Instance.OnDayEvent += OnDay; ctgIdDict = GeneralDefine.ZhanLingCtgIdDict; ctgIdDictH = GeneralDefine.ZhanLingCtgIdHDict; profitRatio = GeneralDefine.ZhanLingProfitRatio[Math.Max(ZhanLingHType - 1, 0)].ToString(); } public void OnBeforePlayerDataInitialize() @@ -52,8 +56,26 @@ public override void UnInit() { TimeMgr.Instance.OnDayEvent -= OnDay; FuncOpen.Instance.OnFuncStateChangeEvent -= OnFunctionStateChange; } private void OnDay() { UpdateRedpoint(ZhanLingHType); UpdateGiftStateEvent?.Invoke(); } private void OnFunctionStateChange(int id) { if (id == FuncId) { UpdateRedpoint(ZhanLingHType); UpdateGiftStateEvent?.Invoke(); } } public void UpdateGiftState(HB120_tagMCZhanlingInfo vNetData) { if (zhanLingInfoDict.ContainsKey(vNetData.ZhanlingType)) @@ -90,20 +112,10 @@ } zhanLingInfoDict[zhanlingInfo.zhanLingType] = zhanlingInfo; } if (vNetData.ZhanlingType == 5) if (vNetData.ZhanlingType == ZhanLingHType) { UpdateRedpoint(5); UpdateRedpoint(ZhanLingHType); UpdateGiftStateEvent?.Invoke(); } } private void OnFunctionStateChange(int id) { if (id == 233) { UpdateRedpoint(5); } } @@ -121,95 +133,134 @@ return result; } // 获得当前按钮显示的状态 // 0 不能领 1 未领取 2 已领取 public int GetGiftState(int zhanLingType, int needValue, bool isFreeGift) public bool IsNeedValueOk(int needValue) { int days = GetDay(); //玩家等级能不能领 if (days >= needValue) int nowNeedValue = GetDay(); return nowNeedValue >= needValue; } //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 public int GetBuyState(int zhanLingType) { bool isBuyPaid = zhanLingInfoDict[zhanLingType].isActivite > 0; bool isBuyPaidH = zhanLingInfoDict[zhanLingType].isActiviteH > 0; if (isBuyPaid && isBuyPaidH) { //是不是免费礼包 if (isFreeGift) { return IsHaveZhanLingGift(zhanLingType, needValue, true) ? 2 : 1; } else { //买没买过付费战令 if (zhanLingInfoDict[zhanLingType].isActivite > 0) { return IsHaveZhanLingGift(zhanLingType, needValue, false) ? 2 : 1; } else { return 0; } } return 3; } else if (isBuyPaid && !isBuyPaidH) { return 1; } else if (!isBuyPaid && isBuyPaidH) { return 2; } else { return 0; } } //发包 public void HaveGift(int zhanLingType, int needValue, bool isFreeGift) // 0 不能领 1 未领取 2 已领取 public int GetFreeGiftState(int zhanLingType, int needValue) { if (IsNeedValueOk(needValue)) { return zhanLingInfoDict[zhanLingType].freeZhanHaveDict[needValue] > 0 ? 2 : 1; } else { return 0; } } // 0 不能领 1 未领取 2 已领取 public int GetPaidGiftState(int zhanLingType, int needValue) { if (IsNeedValueOk(needValue) && zhanLingInfoDict[zhanLingType].isActivite > 0) { return zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValue] > 0 ? 2 : 1; } else { return 0; } } // 0 不能领 1 未领取 2 已领取 public int GetPaidGiftHState(int zhanLingType, int needValue) { if (IsNeedValueOk(needValue) && zhanLingInfoDict[zhanLingType].isActiviteH > 0) { return zhanLingInfoDict[zhanLingType].paidZhanHaveHDict[needValue] > 0 ? 2 : 1; } else { return 0; } } //发包 type 0-免费;1-普通战令;2-高级战令 public void HaveGift(int zhanLingType, int needValue, int type) { var pak = new IL_CA504_tagCMPlayerGetReward(); string dataExStr = isFreeGift ? (needValue * 10 + 0).ToString() : (needValue * 10 + 1).ToString(); string dataExStr = (needValue * 10 + type).ToString(); pak.RewardType = (byte)65; pak.DataEx = (uint)zhanLingType; pak.DataExStrLen = (byte)dataExStr.Length; pak.DataExStr = dataExStr; GameNetSystem.Instance.SendInfo(pak); } //是否领取了当前这档的物品 public bool IsHaveZhanLingGift(int zhanLingType, int needValue, bool isFreeGift) { return isFreeGift ? zhanLingInfoDict[zhanLingType].freeZhanHaveDict[needValue] > 0 : zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValue] > 0; } //获取ItemCell的ID public int GetItemCellID(int zhanLingType, int needValue, bool isFreeGift, int loopIndedx = 0) { return isFreeGift ? ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][needValue]).FreeRewardItemList[0][0] : ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][needValue]).ZLRewardItemList[loopIndedx][0]; } //获取ItemCell的数量 public int GetItemCellCount(int zhanLingType, int needValue, bool isFreeGift, int loopIndedx = 0) { return isFreeGift ? ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][needValue]).FreeRewardItemList[0][1] : ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][needValue]).ZLRewardItemList[loopIndedx][1]; } //获取最小未领取的物品索引 public int GetJumpStartIndex(int zhanLingType) { int days = GetDay(); List<int> zhanLingLvList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); List<int> needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0]; for (int i = 0; i < zhanLingLvList.Count; i++) for (int i = 0; i < needValueList.Count; i++) { if (days >= zhanLingLvList[i]) if (IsNeedValueOk(needValueList[i])) { if (zhanLingInfoDict[zhanLingType].isActivite > 0) bool isHaveFree = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0; bool isHavePaid = zhanLingInfoDict[zhanLingType].paidZhanHaveDict[needValueList[i]] > 0; bool isHavePaidH = zhanLingInfoDict[zhanLingType].paidZhanHaveHDict[needValueList[i]] > 0; if (zhanLingInfoDict[zhanLingType].isActiviteH > 0) { if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], false) || !IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true)) if (!isHaveFree || !isHavePaid || !isHavePaidH) { maxNeedValue = zhanLingLvList[i]; maxNeedValue = needValueList[i]; break; } } else { if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true)) if (zhanLingInfoDict[zhanLingType].isActivite > 0) { maxNeedValue = zhanLingLvList[i]; break; if (!isHaveFree || !isHavePaid) { maxNeedValue = needValueList[i]; break; } } else { if (!isHaveFree) { maxNeedValue = needValueList[i]; break; } } } } } var needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); int startIndex = needValueList.IndexOf(maxNeedValue); var temp = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); int startIndex = temp.IndexOf(maxNeedValue); return Math.Max(0, startIndex); } //一键获取所有可领取的礼品,弹出展示窗口 public void HaveAllZhanLingGift(int zhanLingType) { @@ -221,35 +272,48 @@ } List<int> haveFreeRewardItemList = new List<int>(); //用户领到的免费物品的所需值列表 List<int> havePaidRewardItemList = new List<int>(); //用户领到的付费物品的所需值列表 List<int> havePaidRewardItemHList = new List<int>(); //用户领到的付费物品的所需值列表 var needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); for (int i = 0; i < needValueList.Count; i++) { int freeState = GetGiftState(zhanLingType, needValueList[i], true); int paidState = GetGiftState(zhanLingType, needValueList[i], false); int needValue = needValueList[i]; int freeState = GetFreeGiftState(zhanLingType, needValue); int paidState = GetPaidGiftState(zhanLingType, needValue); int paidHState = GetPaidGiftHState(zhanLingType, needValue); if (freeState == 1) { haveFreeRewardItemList.Add(needValueList[i]); haveFreeRewardItemList.Add(needValue); } if (paidState == 1) { havePaidRewardItemList.Add(needValueList[i]); havePaidRewardItemList.Add(needValue); } if (paidHState == 1) { havePaidRewardItemHList.Add(needValue); } } MergeAllHaveZhanLingGift(zhanLingType, haveFreeRewardItemList, havePaidRewardItemList); MergeAllHaveZhanLingGift(zhanLingType, haveFreeRewardItemList, havePaidRewardItemList, havePaidRewardItemHList); DebugEx.Log($"背包空格 {ModelCenter.Instance.GetModelEx<PackModel>().GetEmptyGridCount(PackType.Item)} 需要格子 {allGiftItemList.Count}"); if (ModelCenter.Instance.GetModelEx<PackModel>().GetEmptyGridCount(PackType.Item) >= allGiftItemList.Count) { for (int i = 0; i < needValueList.Count; i++) { int freeState = GetGiftState(zhanLingType, needValueList[i], true); int paidState = GetGiftState(zhanLingType, needValueList[i], false); int needValue = needValueList[i]; int freeState = GetFreeGiftState(zhanLingType, needValue); int paidState = GetPaidGiftState(zhanLingType, needValue); int paidHState = GetPaidGiftHState(zhanLingType, needValue); if (freeState == 1) { HaveGift(zhanLingType, needValueList[i], true); HaveGift(zhanLingType, needValue, 0); } if (paidState == 1) { HaveGift(zhanLingType, needValueList[i], false); HaveGift(zhanLingType, needValue, 1); } if (paidHState == 1) { HaveGift(zhanLingType, needValue, 2); } } } @@ -263,16 +327,16 @@ WindowJumpMgr.Instance.WindowJumpToEx("HaveZhanLingItemShowWin"); } public void MergeAllHaveZhanLingGift(int zhanLingType, List<int> haveFreeRewardItemList, List<int> havePaidRewardItemList) //type 0 免费物品 1 进阶令物品 2 玄阶进阶令物品 public void MergeAllHaveZhanLingGift(int zhanLingType, List<int> haveFreeRewardItemList, List<int> havePaidRewardItemList, List<int> havePaidRewardItemHList) { for (int i = 0; i < haveFreeRewardItemList.Count; i++) { for (int j = 0; j < ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][haveFreeRewardItemList[i]]).FreeRewardItemList.Length; j++) for (int j = 0; j < ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[haveFreeRewardItemList[i]]).FreeRewardItemList.Length; j++) { ZhanLingGiftItemInfo tempAllGiftItems = new ZhanLingGiftItemInfo(); tempAllGiftItems.id = ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][haveFreeRewardItemList[i]]).FreeRewardItemList[j][0]; tempAllGiftItems.count = ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][haveFreeRewardItemList[i]]).FreeRewardItemList[j][1]; tempAllGiftItems.id = ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[haveFreeRewardItemList[i]]).FreeRewardItemList[j][0]; tempAllGiftItems.count = ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[haveFreeRewardItemList[i]]).FreeRewardItemList[j][1]; tempAllGiftItems.name = ItemConfig.Get(tempAllGiftItems.id).ItemName; tempAllGiftItems.quality = ItemConfig.Get(tempAllGiftItems.id).ItemColor; if (allGiftItemList.Count == 0) @@ -300,11 +364,43 @@ } for (int i = 0; i < havePaidRewardItemList.Count; i++) { for (int j = 0; j < ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][havePaidRewardItemList[i]]).ZLRewardItemList.Length; j++) for (int j = 0; j < ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[havePaidRewardItemList[i]]).ZLRewardItemList.Length; j++) { ZhanLingGiftItemInfo tempAllGiftItems = new ZhanLingGiftItemInfo(); tempAllGiftItems.id = ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][havePaidRewardItemList[i]]).ZLRewardItemList[j][0]; tempAllGiftItems.count = ILZhanlingConfig.Get(typeToIDListDict[zhanLingType][havePaidRewardItemList[i]]).ZLRewardItemList[j][1]; tempAllGiftItems.id = ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[havePaidRewardItemList[i]]).ZLRewardItemList[j][0]; tempAllGiftItems.count = ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[havePaidRewardItemList[i]]).ZLRewardItemList[j][1]; tempAllGiftItems.name = ItemConfig.Get(tempAllGiftItems.id).ItemName; tempAllGiftItems.quality = ItemConfig.Get(tempAllGiftItems.id).ItemColor; if (allGiftItemList.Count == 0) { allGiftItemList.Add(tempAllGiftItems); } else { bool isExist = false; for (int k = 0; k < allGiftItemList.Count; k++) { if (allGiftItemList[k].id == tempAllGiftItems.id) { isExist = true; allGiftItemList[k].count += tempAllGiftItems.count; break; } } if (!isExist) { allGiftItemList.Add(tempAllGiftItems); } } } } for (int i = 0; i < havePaidRewardItemHList.Count; i++) { for (int j = 0; j < ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[havePaidRewardItemHList[i]]).ZLRewardItemListH.Length; j++) { ZhanLingGiftItemInfo tempAllGiftItems = new ZhanLingGiftItemInfo(); tempAllGiftItems.id = ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[havePaidRewardItemHList[i]]).ZLRewardItemListH[j][0]; tempAllGiftItems.count = ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[havePaidRewardItemHList[i]]).ZLRewardItemListH[j][1]; tempAllGiftItems.name = ItemConfig.Get(tempAllGiftItems.id).ItemName; tempAllGiftItems.quality = ItemConfig.Get(tempAllGiftItems.id).ItemColor; if (allGiftItemList.Count == 0) @@ -335,6 +431,7 @@ { return b.quality.CompareTo(a.quality); } //按品质排序 public List<ZhanLingGiftItemInfo> SortAllHaveZhanLingGift() { @@ -345,12 +442,15 @@ void UpdateRedpoint(int zhanLingType) { redpoint.state = RedPointState.None; if (zhanLingInfoDict == null || !zhanLingInfoDict.ContainsKey(zhanLingType) || zhanLingInfoDict[zhanLingType].freeZhanHaveDict == null || !FuncOpen.Instance.IsFuncOpen(233)) if (zhanLingInfoDict == null || !zhanLingInfoDict.ContainsKey(zhanLingType)) return; var needValueList = zhanLingInfoDict[zhanLingType].freeZhanHaveDict.Keys.ToList(); var needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); for (int i = 0; i < needValueList.Count; i++) { if (GetGiftState(zhanLingType, needValueList[i], true) == 1 || GetGiftState(zhanLingType, needValueList[i], false) == 1) int freeState = GetFreeGiftState(zhanLingType, needValueList[i]); int paidState = GetPaidGiftState(zhanLingType, needValueList[i]); int paidHState = GetPaidGiftHState(zhanLingType, needValueList[i]); if (freeState == 1 || paidState == 1 || paidHState == 1) { redpoint.state = RedPointState.Simple; break; @@ -358,22 +458,23 @@ } } //已经购买并领取所有物品 public bool IsFinish() { int zhanLingType = 5; int zhanLingType = ZhanLingHType; if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.TryGetValue(zhanLingType, out var zhanlingInfo) || zhanlingInfo == null || zhanlingInfo.freeZhanHaveDict == null || zhanlingInfo.paidZhanHaveDict == null) return false; //有没购买的 if (zhanlingInfo.isActivite == 0) if (GetBuyState(zhanLingType) != 3) return false; //有没领取的物品 var arr = zhanlingInfo.freeZhanHaveDict.Keys.ToArray(); for (int i = 0; i < arr.Length; i++) { int needValue = arr[i]; if (!IsHaveZhanLingGift(zhanLingType, needValue, false) || !IsHaveZhanLingGift(zhanLingType, needValue, true)) if (GetFreeGiftState(zhanLingType, needValue) != 2 || GetPaidGiftState(zhanLingType, needValue) != 2 || GetPaidGiftHState(zhanLingType, needValue) != 2) return false; } return true; System/ZhanLing/LoginZhanLingWin.cs
@@ -7,40 +7,52 @@ public class LoginZhanLingWin : Window { [SerializeField] ScrollerController scroller; [SerializeField] TextEx txtBuy; [SerializeField] TextEx txtProfitRatio; [SerializeField] ButtonEx btnClose; [SerializeField] ButtonEx btnBuy; [SerializeField] ImageEx imgBuy; VipModel vipModel { get { return ModelCenter.Instance.GetModelEx<VipModel>(); } } LoginZhanLingModel loginZhanLingModel { get { return ModelCenter.Instance.GetModelEx<LoginZhanLingModel>(); } } [SerializeField] ButtonEx btnPaidLock; [SerializeField] ButtonEx btnPaidLockH; [SerializeField] TextEx txtPaidLock; [SerializeField] TextEx txtPaidLockH; VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } ZhanLingHBuyModel zhanLingHBuyModel { get { return ModelCenter.Instance.GetModel<ZhanLingHBuyModel>(); } } LoginZhanLingModel model { get { return ModelCenter.Instance.GetModel<LoginZhanLingModel>(); } } protected override void AddListeners() { btnClose.SetListener(() => { WindowCenter.Instance.Close<LoginZhanLingWin>(); WindowCenter.Instance.Close<MountedPetZhanLingWin>(); }); btnBuy.SetListener(() => btnPaidLock.SetListener(() => { vipModel.CTG(loginZhanLingModel.ctgIdDict[5]); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG2"); }); btnPaidLockH.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyBG2"); }); } protected override void OnPreOpen() { loginZhanLingModel.UpdateGiftStateEvent += UpdateGiftStateEvent; model.UpdateGiftStateEvent += UpdateGiftStateEvent; scroller.OnRefreshCell += OnScrollerRefreshCell; TimeMgr.Instance.OnDayEvent += OnDay; vipModel.rechargeCountEvent += OnRechargeCountEvent; Display(); } bool isBuyZhanLing = loginZhanLingModel.zhanLingInfoDict[5].isActivite > 0; btnBuy.SetActiveIL(!isBuyZhanLing); imgBuy.SetActiveIL(isBuyZhanLing); OrderInfoConfig orderCfg; vipModel.TryGetOrderInfo(loginZhanLingModel.ctgIdDict[5], out orderCfg); txtBuy.text = Language.Get("PayMoneyNum", orderCfg.PayRMBNum); txtProfitRatio.text = loginZhanLingModel.profitRatio; void Display() { //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 int buyState = model.GetBuyState(model.ZhanLingHType); int ctgId1 = model.ctgIdDict[model.ZhanLingHType][0]; int ctgId2 = model.ctgIdDictH[model.ZhanLingHType][0]; scroller.m_Scorller.RefreshActiveCellViews(); btnPaidLock.SetActive(buyState == 0 || buyState == 2); btnPaidLockH.SetActive(buyState == 0 || buyState == 1); txtPaidLock.text = CTGConfig.Get(ctgId1).Title; txtPaidLockH.text = CTGConfig.Get(ctgId2).Title; model.IsPlayAnimation = true; } protected override void OnAfterOpen() @@ -51,45 +63,48 @@ protected override void OnPreClose() { loginZhanLingModel.UpdateGiftStateEvent -= UpdateGiftStateEvent; model.UpdateGiftStateEvent -= UpdateGiftStateEvent; scroller.OnRefreshCell -= OnScrollerRefreshCell; TimeMgr.Instance.OnDayEvent -= OnDay; vipModel.rechargeCountEvent -= OnRechargeCountEvent; } void OnDay() void OnUpdateSoulInfos(bool noChangeCnt) { if (loginZhanLingModel.zhanLingInfoDict == null || !loginZhanLingModel.zhanLingInfoDict.ContainsKey(5)) return; scroller.m_Scorller.RefreshActiveCellViews(); loginZhanLingModel.IsPlayAnimation = true; Display(); } void OnRechargeCountEvent(int obj) { if (obj == model.ctgIdDict[model.ZhanLingHType][0] || obj == model.ctgIdDictH[model.ZhanLingHType][0]) { Display(); } } private void UpdateGiftStateEvent() { scroller.m_Scorller.RefreshActiveCellViews(); bool isBuyZhanLing = loginZhanLingModel.zhanLingInfoDict[5].isActivite > 0; btnBuy.SetActiveIL(!isBuyZhanLing); imgBuy.SetActiveIL(isBuyZhanLing); loginZhanLingModel.IsPlayAnimation = true; Display(); } private void OnScrollerRefreshCell(ScrollerDataType type, CellView cell) { var _cell = cell as LoginZhanLingCell; _cell.Display(_cell.index); loginZhanLingModel.IsPlayAnimation = true; model.IsPlayAnimation = true; } void Initialize() { List<int> cellList = ILZhanlingConfig.GetTypeToIDDict(5).Keys.ToList(); List<int> cellList = ILZhanlingConfig.GetTypeToIDDict(model.ZhanLingHType).Keys.ToList(); scroller.Refresh(); for (int i = 0; i < cellList.Count; i++) { scroller.AddCell(ScrollerDataType.Header, cellList[i]); } scroller.Restart(); scroller.JumpIndex(loginZhanLingModel.GetJumpStartIndex(5)); loginZhanLingModel.IsPlayAnimation = true; scroller.JumpIndex(model.GetJumpStartIndex(model.ZhanLingHType)); model.IsPlayAnimation = true; } System/ZhanLingH/GatheringSoulZhanLingCell.cs
@@ -131,7 +131,7 @@ //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 2) { zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType,1, "ZhanLingHBuyTitle1"); zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType,1); } else { @@ -158,7 +158,7 @@ //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 1) { zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType, 2, "ZhanLingHBuyTitle2"); zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType, 2); } else { System/ZhanLingH/GatheringSoulZhanLingModel.cs
@@ -460,7 +460,7 @@ zhanlingInfo == null || zhanlingInfo.freeZhanHaveDict == null || zhanlingInfo.paidZhanHaveDict == null) return false; //有没购买的 if (GetBuyState(zhanLingType) != 4) if (GetBuyState(zhanLingType) != 3) return false; //有没领取的物品 var arr = zhanlingInfo.freeZhanHaveDict.Keys.ToArray(); System/ZhanLingH/GatheringSoulZhanLingWin.cs
@@ -10,6 +10,8 @@ [SerializeField] ButtonEx btnClose; [SerializeField] ButtonEx btnPaidLock; [SerializeField] ButtonEx btnPaidLockH; [SerializeField] TextEx txtPaidLock; [SerializeField] TextEx txtPaidLockH; [SerializeField] TextEx txtNowNeedValue; VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } ZhanLingHBuyModel zhanLingHBuyModel { get { return ModelCenter.Instance.GetModel<ZhanLingHBuyModel>(); } } @@ -28,12 +30,12 @@ btnPaidLock.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType, 1, "ZhanLingHBuyTitle1"); zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType, 1); }); btnPaidLockH.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType, 2, "ZhanLingHBuyTitle2"); zhanLingHBuyModel.ShowZhanLingHBuy(GatheringSoulZhanLingModel.ZhanLingHType, 2); }); } @@ -51,9 +53,13 @@ //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 int buyState = model.GetBuyState(GatheringSoulZhanLingModel.ZhanLingHType); scroller.m_Scorller.RefreshActiveCellViews(); int ctgId1 = model.ctgIdDict[GatheringSoulZhanLingModel.ZhanLingHType][0]; int ctgId2 = model.ctgIdDictH[GatheringSoulZhanLingModel.ZhanLingHType][0]; txtNowNeedValue.text = Language.Get("GatheringSoulZhanLing05", gsModel.GetGatherSoulTotalLV()); btnPaidLock.SetActive(buyState == 0 || buyState == 2); btnPaidLockH.SetActive(buyState == 0 || buyState == 1); txtPaidLock.text = CTGConfig.Get(ctgId1).Title; txtPaidLockH.text = CTGConfig.Get(ctgId2).Title; model.IsPlayAnimation = true; } System/ZhanLingH/GuBaoCultivateZhanLingCell.cs
@@ -130,7 +130,7 @@ //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 2) { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType,1, "ZhanLingHBuyTitle1", "ZhanLingHBuyBG3"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG3"); } else { @@ -157,7 +157,7 @@ //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 1) { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyTitle2", "ZhanLingHBuyBG3"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyBG3"); } else { System/ZhanLingH/GuBaoCultivateZhanLingModel.cs
@@ -441,7 +441,7 @@ zhanlingInfo == null || zhanlingInfo.freeZhanHaveDict == null || zhanlingInfo.paidZhanHaveDict == null) return false; //有没购买的 if (GetBuyState(zhanLingType) != 4) if (GetBuyState(zhanLingType) != 3) return false; //有没领取的物品 var arr = zhanlingInfo.freeZhanHaveDict.Keys.ToArray(); System/ZhanLingH/GuBaoCultivateZhanLingWin.cs
@@ -9,6 +9,8 @@ [SerializeField] ScrollerController scroller; [SerializeField] ButtonEx btnPaidLock; [SerializeField] ButtonEx btnPaidLockH; [SerializeField] TextEx txtPaidLock; [SerializeField] TextEx txtPaidLockH; [SerializeField] TextEx txtNowNeedValue; VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } ZhanLingHBuyModel zhanLingHBuyModel { get { return ModelCenter.Instance.GetModel<ZhanLingHBuyModel>(); } } @@ -18,12 +20,12 @@ { btnPaidLock.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyTitle1", "ZhanLingHBuyBG3"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG3"); }); btnPaidLockH.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyTitle2", "ZhanLingHBuyBG3"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyBG3"); }); } @@ -43,6 +45,10 @@ txtNowNeedValue.text = Language.Get("GuBaoCultivateZhanLing01", treasurePavilionRankActModel.actScore); btnPaidLock.SetActive(buyState == 0 || buyState == 2); btnPaidLockH.SetActive(buyState == 0 || buyState == 1); int ctgId1 = model.ctgIdDict[model.ZhanLingHType][0]; int ctgId2 = model.ctgIdDictH[model.ZhanLingHType][0]; txtPaidLock.text = CTGConfig.Get(ctgId1).Title; txtPaidLockH.text = CTGConfig.Get(ctgId2).Title; model.IsPlayAnimation = true; } System/ZhanLingH/MountedPetZhanLingCell.cs
@@ -131,7 +131,7 @@ //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 2) { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType,1, "ZhanLingHBuyTitle1", "ZhanLingHBuyBG2"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG2"); } else { @@ -158,7 +158,7 @@ //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 1) { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyTitle2", "ZhanLingHBuyBG2"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyBG2"); } else { System/ZhanLingH/MountedPetZhanLingModel.cs
@@ -442,7 +442,7 @@ zhanlingInfo == null || zhanlingInfo.freeZhanHaveDict == null || zhanlingInfo.paidZhanHaveDict == null) return false; //有没购买的 if (GetBuyState(zhanLingType) != 4) if (GetBuyState(zhanLingType) != 3) return false; //有没领取的物品 var arr = zhanlingInfo.freeZhanHaveDict.Keys.ToArray(); System/ZhanLingH/MountedPetZhanLingWin.cs
@@ -10,6 +10,8 @@ [SerializeField] ButtonEx btnClose; [SerializeField] ButtonEx btnPaidLock; [SerializeField] ButtonEx btnPaidLockH; [SerializeField] TextEx txtPaidLock; [SerializeField] TextEx txtPaidLockH; [SerializeField] TextEx txtNowNeedValue; VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } ZhanLingHBuyModel zhanLingHBuyModel { get { return ModelCenter.Instance.GetModel<ZhanLingHBuyModel>(); } } @@ -24,12 +26,12 @@ btnPaidLock.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyTitle1", "ZhanLingHBuyBG2"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG2"); }); btnPaidLockH.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyTitle2", "ZhanLingHBuyBG2"); zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyBG2"); }); } @@ -49,6 +51,10 @@ txtNowNeedValue.text = Language.Get("MountedPetZhanLingWin01", petHorseActModel.actScore); btnPaidLock.SetActive(buyState == 0 || buyState == 2); btnPaidLockH.SetActive(buyState == 0 || buyState == 1); int ctgId1 = model.ctgIdDict[model.ZhanLingHType][0]; int ctgId2 = model.ctgIdDictH[model.ZhanLingHType][0]; txtPaidLock.text = CTGConfig.Get(ctgId1).Title; txtPaidLockH.text = CTGConfig.Get(ctgId2).Title; model.IsPlayAnimation = true; } System/ZhanLingH/ZhanLingHBuyModel.cs
@@ -7,7 +7,6 @@ { public int zhanLingType; //高级战令类型 public int showGiftType; //1 普通战令礼包 2 高级战令礼包 public string titleIconkey; //标题在Icon表中的KEY public string bgIconkey; //背景在Icon表中的KEY public string profitRatio; @@ -28,11 +27,10 @@ } public void ShowZhanLingHBuy(int zhanLingType, int showGiftType, string titleIconkey, string bgIconkey = null) public void ShowZhanLingHBuy(int zhanLingType, int showGiftType, string bgIconkey = null) { this.zhanLingType = zhanLingType; this.showGiftType = showGiftType; this.titleIconkey = titleIconkey; this.bgIconkey = bgIconkey; if (!WindowCenter.Instance.IsOpen<ZhanLingHBuyWin>()) WindowCenter.Instance.Open<ZhanLingHBuyWin>(); System/ZhanLingH/ZhanLingHBuyWin.cs
@@ -7,8 +7,8 @@ [SerializeField] ButtonEx btnClose; [SerializeField] ButtonEx btnBuy; [SerializeField] TextEx txtBuy; [SerializeField] TextEx txtTitle; [SerializeField] ImageEx imgBK; [SerializeField] ImageEx imgTitle; [SerializeField] TextEx txtPercentage; VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } ZhanLingHBuyModel model { get { return ModelCenter.Instance.GetModel<ZhanLingHBuyModel>(); } } @@ -49,8 +49,7 @@ { imgBK.SetSprite(model.bgIconkey); } imgTitle.SetSprite(model.titleIconkey); imgTitle.SetNativeSize(); txtTitle.text = CTGConfig.Get(ctgID).Title; txtPercentage.text = Language.Get("BlessedLand039", CTGConfig.Get(ctgID).Percentage); txtBuy.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat((long)orderCfg.PayRMBNum)); }