| Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB120_tagMCZhanlingInfo.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LogicProject/System/Recharge/RechargeGenerousGiftModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/FindPrecious/WorldBossModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/MainInterfacePanel/MainRedDot.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WindowBase/ModelCenter.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ZhanLingH/PhantasmPavilionZhanLingCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ZhanLingH/PhantasmPavilionZhanLingCell.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ZhanLingH/PhantasmPavilionZhanLingModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ZhanLingH/PhantasmPavilionZhanLingModel.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ZhanLingH/PhantasmPavilionZhanLingWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ZhanLingH/PhantasmPavilionZhanLingWin.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB120_tagMCZhanlingInfo.cs
@@ -16,5 +16,6 @@ ModelCenter.Instance.GetModelEx<GatheringSoulZhanLingModel>().UpdateGiftState(vNetData); ModelCenter.Instance.GetModelEx<MountedPetZhanLingModel>().UpdateGiftState(vNetData); ModelCenter.Instance.GetModelEx<GuBaoCultivateZhanLingModel>().UpdateGiftState(vNetData); ModelCenter.Instance.GetModelEx<PhantasmPavilionZhanLingModel>().UpdateGiftState(vNetData); } } LogicProject/System/Recharge/RechargeGenerousGiftModel.cs
@@ -117,7 +117,12 @@ { return ModelCenter.Instance.GetModel<LoginZhanLingModel>().IsFinish(); } else if (winID == 14) { return ModelCenter.Instance.GetModel<PhantasmPavilionZhanLingModel>().IsFinish(); } return false; } } System/FindPrecious/WorldBossModel.cs
@@ -61,7 +61,15 @@ } } public int killCntTotal; public event Action killCntEvent; int m_killCntTotal = 0; public int killCntTotal { get { return m_killCntTotal; } set { m_killCntTotal = value; killCntEvent?.Invoke(); } } public bool funcOpenClickSymbol { get { return LocalSave.GetBool("WorldBossClickSymbol_" + PlayerDatas.Instance.PlayerId); } System/MainInterfacePanel/MainRedDot.cs
@@ -136,6 +136,7 @@ public const int TreasurePavilionRankActRepoint = 457; //古宝养成排行榜活动 public const int CelestialPalaceRepoint = 458; //仙宫 public const int PhantasmPavilionRepoint = 459; //幻境阁 public const int PhantasmPavilionZhanLingRepoint = 460; //幻境战令 System/WindowBase/ModelCenter.cs
@@ -280,6 +280,7 @@ RegisterModel<ChooseItemsModel>(); RegisterModel<FairyEmblemModel>(); RegisterModel<PhantasmPavilionModel>(); RegisterModel<PhantasmPavilionZhanLingModel>(); inited = true; } System/ZhanLingH/PhantasmPavilionZhanLingCell.cs
New file @@ -0,0 +1,229 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; namespace vnxbqy.UI { public class PhantasmPavilionZhanLingCell : CellView { [SerializeField] ImageEx imgUnlockLV; [SerializeField] ImageEx imgFreeHave; [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>(); [SerializeField] List<RotationTween> paidItemCellTweenHList = new List<RotationTween>(); VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } PhantasmPavilionZhanLingModel model { get { return ModelCenter.Instance.GetModel<PhantasmPavilionZhanLingModel>(); } } ZhanLingHBuyModel zhanLingHBuyModel { get { return ModelCenter.Instance.GetModel<ZhanLingHBuyModel>(); } } int curValue = 0; int zhanlingId; private void OnEnable() { model.PlayAnimationSync += OnPlaySyncAnimation; if (curValue == 0) return; 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) { freeItemCellTween.Play(); } if (paidState == 1) { for (int i = 0; i < paidItemCellTweenList.Count; i++) { 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 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].SetActive(paidState == 2); imgPaidLockList[i].SetActive(paidState == 0); } for (int i = 0; i < paidItemCellHList.Count; i++) { imgPaidHaveHList[i].SetActive(paidHState == 2); imgPaidLockHList[i].SetActive(paidHState == 0); } imgUnlockLV.gray = !this.model.IsNeedValueOk(needValue); txtUnlockLV.text = needValue.ToString(); txtUnlockLV.colorType = this.model.IsNeedValueOk(needValue) ? TextColType.NavyBrown : TextColType.White; //让第一个cell的进度条不凸出 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 + 30, imgBrownProgressBar.rectTransform.sizeDelta.y); imgGreenProgressBar.rectTransform.sizeDelta = new Vector2(imgBG.rectTransform.sizeDelta.x + 30, imgGreenProgressBar.rectTransform.sizeDelta.y); } //展示ItemCell 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) { this.model.HaveAllZhanLingGift(model.ZhanLingHType); } else { ItemTipUtility.Show(itemId); } }); for (int i = 0; i < paidItemCellList.Count; 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(() => { //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 if (buyState == 0 || buyState == 2) { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG2"); } else { 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(); } private void OnDisable() { model.PlayAnimationSync -= OnPlaySyncAnimation; } //播放旋转动画 private 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) { freeItemCellTween.Play(); } for (int i = 0; i < paidItemCellTweenList.Count; i++) { if (paidItemCellTweenList[i].isActiveAndEnabled && paidState == 1) { paidItemCellTweenList[i].Play(); } } for (int i = 0; i < paidItemCellTweenHList.Count; i++) { if (paidItemCellTweenHList[i].isActiveAndEnabled && paidHState == 1) { paidItemCellTweenHList[i].Play(); } } } private void OnPlaySyncAnimation() { PlayAnimation(); } } } System/ZhanLingH/PhantasmPavilionZhanLingCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: db89c11c101487646b1ae3967bd5232c MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/ZhanLingH/PhantasmPavilionZhanLingModel.cs
New file @@ -0,0 +1,475 @@ using System; using System.Collections.Generic; using System.Linq; namespace vnxbqy.UI { public class PhantasmPavilionZhanLingModel : Model, IBeforePlayerDataInitialize { public readonly int ZhanLingHType = 10; public readonly int FuncId = 238; // 高级战令类型对应的充值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>(); public Action UpdateGiftStateEvent; public Redpoint redpoint = new Redpoint(MainRedPoint.RechargeGenerousGiftWinRedpoint, MainRedDot.PhantasmPavilionZhanLingRepoint); List<ZhanLingGiftItemInfo> allGiftItemList = new List<ZhanLingGiftItemInfo>(); WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } } //同步播放摆动动画 public Action PlayAnimationSync; private bool isPlayAnimation = false; public bool IsPlayAnimation { get { return isPlayAnimation; } set { isPlayAnimation = value; if (isPlayAnimation) { PlayAnimationSync?.Invoke(); } isPlayAnimation = false; } } public override void Init() { FuncOpen.Instance.OnFuncStateChangeEvent += OnFunctionStateChange; worldBossModel.killCntEvent += OnkillCntEvent; ctgIdDict = GeneralDefine.ZhanLingCtgIdDict; ctgIdDictH = GeneralDefine.ZhanLingCtgIdHDict; } public void OnBeforePlayerDataInitialize() { zhanLingInfoDict.Clear(); } public override void UnInit() { FuncOpen.Instance.OnFuncStateChangeEvent -= OnFunctionStateChange; worldBossModel.killCntEvent -= OnkillCntEvent; } private void OnFunctionStateChange(int obj) { if (obj == FuncId) { UpdateRedpoint(ZhanLingHType); UpdateGiftStateEvent?.Invoke(); } } private void OnkillCntEvent() { UpdateRedpoint(ZhanLingHType); UpdateGiftStateEvent?.Invoke(); } public void UpdateGiftState(HB120_tagMCZhanlingInfo vNetData) { if (zhanLingInfoDict.ContainsKey(vNetData.ZhanlingType)) { zhanLingInfoDict[vNetData.ZhanlingType].isActivite = vNetData.IsActivite; zhanLingInfoDict[vNetData.ZhanlingType].isActiviteH = vNetData.IsActiviteH; zhanLingInfoDict[vNetData.ZhanlingType].value1 = (int)vNetData.Value1; if (vNetData.RewardCount != 0) { for (int i = 0; i < vNetData.RewardCount; i++) { zhanLingInfoDict[vNetData.ZhanlingType].freeZhanHaveDict[(int)vNetData.RewardList[i].NeedValue] = (int)vNetData.RewardList[i].FreeRewardState; zhanLingInfoDict[vNetData.ZhanlingType].paidZhanHaveDict[(int)vNetData.RewardList[i].NeedValue] = (int)vNetData.RewardList[i].ZLRewardState; zhanLingInfoDict[vNetData.ZhanlingType].paidZhanHaveHDict[(int)vNetData.RewardList[i].NeedValue] = (int)vNetData.RewardList[i].ZLRewardStateH; } } } else { ZhanlingInfo zhanlingInfo = new ZhanlingInfo(); zhanlingInfo.zhanLingType = vNetData.ZhanlingType; zhanlingInfo.isActivite = vNetData.IsActivite; zhanlingInfo.isActiviteH = vNetData.IsActiviteH; zhanlingInfo.rewardCount = vNetData.RewardCount; zhanlingInfo.value1 = (int)vNetData.Value1; zhanlingInfo.freeZhanHaveDict = new Dictionary<int, int>(); zhanlingInfo.paidZhanHaveDict = new Dictionary<int, int>(); zhanlingInfo.paidZhanHaveHDict = new Dictionary<int, int>(); for (int i = 0; i < zhanlingInfo.rewardCount; i++) { zhanlingInfo.freeZhanHaveDict[(int)vNetData.RewardList[i].NeedValue] = vNetData.RewardList[i].FreeRewardState; zhanlingInfo.paidZhanHaveDict[(int)vNetData.RewardList[i].NeedValue] = vNetData.RewardList[i].ZLRewardState; zhanlingInfo.paidZhanHaveHDict[(int)vNetData.RewardList[i].NeedValue] = vNetData.RewardList[i].ZLRewardStateH; } zhanLingInfoDict[zhanlingInfo.zhanLingType] = zhanlingInfo; } if (vNetData.ZhanlingType == ZhanLingHType) { UpdateRedpoint(ZhanLingHType); UpdateGiftStateEvent?.Invoke(); } } public int GetValue1() { return zhanLingInfoDict.ContainsKey(ZhanLingHType) ? zhanLingInfoDict[ZhanLingHType].value1 : 0; } public bool IsNeedValueOk(int needValue) { int nowNeedValue = GetValue1(); 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) { return 3; } else if (isBuyPaid && !isBuyPaidH) { return 1; } else if (!isBuyPaid && isBuyPaidH) { return 2; } else { return 0; } } // 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 = (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 int GetJumpStartIndex(int zhanLingType) { List<int> needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0]; for (int i = 0; i < needValueList.Count; i++) { if (IsNeedValueOk(needValueList[i])) { 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 (!isHaveFree || !isHavePaid || !isHavePaidH) { maxNeedValue = needValueList[i]; break; } } else { if (zhanLingInfoDict[zhanLingType].isActivite > 0) { if (!isHaveFree || !isHavePaid) { maxNeedValue = needValueList[i]; break; } } else { if (!isHaveFree) { maxNeedValue = needValueList[i]; break; } } } } } var temp = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); int startIndex = temp.IndexOf(maxNeedValue); return Math.Max(0, startIndex); } //一键获取所有可领取的礼品,弹出展示窗口 public void HaveAllZhanLingGift(int zhanLingType) { //没有格子 if (ModelCenter.Instance.GetModelEx<PackModel>().GetEmptyGridCount(PackType.Item) < 1) { SysNotifyMgr.Instance.ShowTip("GeRen_lhs_202580"); return; } 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 needValue = needValueList[i]; int freeState = GetFreeGiftState(zhanLingType, needValue); int paidState = GetPaidGiftState(zhanLingType, needValue); int paidHState = GetPaidGiftHState(zhanLingType, needValue); if (freeState == 1) { haveFreeRewardItemList.Add(needValue); } if (paidState == 1) { havePaidRewardItemList.Add(needValue); } if (paidHState == 1) { havePaidRewardItemHList.Add(needValue); } } 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 needValue = needValueList[i]; int freeState = GetFreeGiftState(zhanLingType, needValue); int paidState = GetPaidGiftState(zhanLingType, needValue); int paidHState = GetPaidGiftHState(zhanLingType, needValue); if (freeState == 1) { HaveGift(zhanLingType, needValue, 0); } if (paidState == 1) { HaveGift(zhanLingType, needValue, 1); } if (paidHState == 1) { HaveGift(zhanLingType, needValue, 2); } } } else { SysNotifyMgr.Instance.ShowTip("GeRen_lhs_202580"); return; } HaveZhanLingItemShowModel.Instance.allGiftItemList = new List<ZhanLingGiftItemInfo>(SortAllHaveZhanLingGift()); allGiftItemList.Clear(); WindowJumpMgr.Instance.WindowJumpToEx("HaveZhanLingItemShowWin"); } //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(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[haveFreeRewardItemList[i]]).FreeRewardItemList.Length; j++) { ZhanLingGiftItemInfo tempAllGiftItems = new ZhanLingGiftItemInfo(); 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) { 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 < havePaidRewardItemList.Count; i++) { for (int j = 0; j < ILZhanlingConfig.Get(ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[havePaidRewardItemList[i]]).ZLRewardItemList.Length; j++) { ZhanLingGiftItemInfo tempAllGiftItems = new ZhanLingGiftItemInfo(); 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) { 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); } } } } } private int SortGift(ZhanLingGiftItemInfo a, ZhanLingGiftItemInfo b) { return b.quality.CompareTo(a.quality); } //按品质排序 public List<ZhanLingGiftItemInfo> SortAllHaveZhanLingGift() { allGiftItemList.Sort(SortGift); return allGiftItemList; } private void UpdateRedpoint(int zhanLingType) { redpoint.state = RedPointState.None; if (zhanLingInfoDict == null || !zhanLingInfoDict.ContainsKey(zhanLingType)) return; if (!FuncOpen.Instance.IsFuncOpen(FuncId)) return; var needValueList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList(); for (int i = 0; i < needValueList.Count; i++) { 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; } } } //已经购买并领取所有物品 public bool IsFinish() { int zhanLingType = ZhanLingHType; if (zhanLingInfoDict.IsNullOrEmpty() || !zhanLingInfoDict.TryGetValue(zhanLingType, out var zhanlingInfo) || zhanlingInfo == null || zhanlingInfo.freeZhanHaveDict == null || zhanlingInfo.paidZhanHaveDict == null) return false; //有没购买的 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 (GetFreeGiftState(zhanLingType, needValue) != 2 || GetPaidGiftState(zhanLingType, needValue) != 2 || GetPaidGiftHState(zhanLingType, needValue) != 2) return false; } return true; } } } System/ZhanLingH/PhantasmPavilionZhanLingModel.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: eacc79c389710a24f9d5dc6600bb8cd8 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/ZhanLingH/PhantasmPavilionZhanLingWin.cs
New file @@ -0,0 +1,119 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; namespace vnxbqy.UI { // 幻境战令 public class PhantasmPavilionZhanLingWin : Window { [SerializeField] ScrollerController scroller; [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>(); } } PhantasmPavilionZhanLingModel model { get { return ModelCenter.Instance.GetModel<PhantasmPavilionZhanLingModel>(); } } WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } } protected override void AddListeners() { btnClose.SetListener(() => { CloseClick(); }); btnPaidLock.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 1, "ZhanLingHBuyBG2"); }); btnPaidLockH.SetListener(() => { zhanLingHBuyModel.ShowZhanLingHBuy(model.ZhanLingHType, 2, "ZhanLingHBuyBG2"); }); } protected override void OnPreOpen() { model.UpdateGiftStateEvent += UpdateGiftStateEvent; scroller.OnRefreshCell += OnScrollerRefreshCell; vipModel.rechargeCountEvent += OnRechargeCountEvent; Display(); } private void Display() { //0 没购买进阶和玄级 1 购买了进阶没买玄级 2 购买了玄级没买进阶 3 购买了进阶和玄级 int buyState = model.GetBuyState(model.ZhanLingHType); scroller.m_Scorller.RefreshActiveCellViews(); txtNowNeedValue.text = Language.Get("PhantasmPavilionZhanLing02", model.GetValue1()); 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; } protected override void OnAfterOpen() { Initialize(); } protected override void OnPreClose() { model.UpdateGiftStateEvent -= UpdateGiftStateEvent; scroller.OnRefreshCell -= OnScrollerRefreshCell; vipModel.rechargeCountEvent -= OnRechargeCountEvent; } private void OnRechargeCountEvent(int obj) { if (obj == model.ctgIdDict[model.ZhanLingHType][0] || obj == model.ctgIdDictH[model.ZhanLingHType][0]) { Display(); scroller.m_Scorller.RefreshActiveCellViews(); } } private void UpdateGiftStateEvent() { Display(); scroller.m_Scorller.RefreshActiveCellViews(); } private void OnScrollerRefreshCell(ScrollerDataType type, CellView cell) { var _cell = cell as PhantasmPavilionZhanLingCell; _cell.Display(_cell.index); model.IsPlayAnimation = true; } private void Initialize() { 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(model.GetJumpStartIndex(model.ZhanLingHType)); model.IsPlayAnimation = true; } protected override void BindController() { } protected override void OnAfterClose() { } } } System/ZhanLingH/PhantasmPavilionZhanLingWin.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: c158be99730829642a191a8770c72353 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: