Main/System/Battle/BattleField/StoryBattleField.cs
@@ -323,7 +323,7 @@ //暂停的原因有很多,需要检查各种状态 protected override bool CanResumeGame() { if (NewBieCenter.Instance.IsPauseStoryBattleState()) if (NewBieCenter.Instance.IsNeedRecord(NewBieCenter.Instance.currentGuide)) { return false; } Main/System/Equip/EquipModel.cs
@@ -10,6 +10,7 @@ { public const int TotleEquip = 12; //装备栏大小 public bool waitEquipOPPack = false; // 穿戴装备的操作 不含分解 public float waitEquipOPTime = 0; public event Action<bool, int> OnEquipOPResultAction; //是否换上了新装备且分解了 装备索引 public event Action<BattleDrops> OnItemDropEvent; @@ -36,6 +37,7 @@ EventBroadcast.Instance.AddListener<string, BattleDrops, Action>(EventName.BATTLE_DROP_ITEMS, OnDropEvent); EventBroadcast.Instance.AddListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnSkillCast); EventBroadcast.Instance.AddListener<string>(EventName.RECORDPLAYER_END, RecordPlayerEnd); GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; ParseConfig(); } @@ -46,6 +48,7 @@ EventBroadcast.Instance.RemoveListener<string, BattleDrops, Action>(EventName.BATTLE_DROP_ITEMS, OnDropEvent); EventBroadcast.Instance.RemoveListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnSkillCast); EventBroadcast.Instance.RemoveListener<string>(EventName.RECORDPLAYER_END, RecordPlayerEnd); GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; } @@ -191,6 +194,16 @@ } } void OnSecondEvent() { if (waitEquipOPPack && Time.time - waitEquipOPTime > 2) { //避免装备卡死无法继续主线 waitEquipOPPack = false; } } private void OnEquipResult(HA814_tagMCMakeItemAnswer info) { if (info.MakeType != (int)MakeType.EquipOP) @@ -199,7 +212,10 @@ return; if (info.MakeValue == 2) { waitEquipOPPack = false; Debug.LogWarning("穿戴装备,服务器响应解除等待状态"); } bool isDone = false; // 换上新装备且分解了旧装备 //选中的地板装备进行处理,替换还是找下一件,检查OnEquipOPResultAction if (selectFloorEquip != null) @@ -259,7 +275,11 @@ pack.OPValue = (byte)(autoDecompose ? 1 : 0); // 替换后是否自动分解原装备:0否1是 if (opType == 2) { waitEquipOPPack = true; waitEquipOPTime = Time.time; Debug.LogWarning("穿戴装备,向服务器请求"); } GameNetSystem.Instance.SendInfo(pack); } @@ -310,7 +330,10 @@ return false; if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin) { Debug.LogWarning("OpenEquipExchangeWin: 未登录"); return false; } // if (!IsEquip(equip)) // return false; @@ -325,7 +348,10 @@ waitEquipOP.Enqueue(equip.gridIndex); //未回复装备操作结果,否则会显示旧装备 if (waitEquipOPPack) { Debug.LogError("OpenEquipExchangeWin: 等待服务器响应"); return false; } if (UIManager.Instance.IsOpened<EquipExchangeWin>()) @@ -351,11 +377,17 @@ // 新手引导中,不允许切换装备界面 if (NewBieCenter.Instance.inGuiding) { Debug.LogWarning("GetSelectFloorEquip: 新手引导中,不允许切换装备界面"); return null; } string activeBattleName = BattleManager.Instance.GetActiveBattleName(); if (activeBattleName != "" && activeBattleName != "StoryBattleField") { Debug.LogWarning("非主线战斗不弹窗"); return null; } return PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue()); Main/System/Equip/FloorItemCell.cs
@@ -22,7 +22,7 @@ /// </summary> /// <param name="index">掉落背包索引</param> /// <param name="isAnimate">是否播放掉落动画</param> public async UniTask Display(int index, bool isAnimate, RectTransform rect) public async UniTask Display(int index, bool isAnimate, Vector3 position) { await UniTask.Delay(300); itemIndex = index; @@ -48,8 +48,8 @@ uieff.Play(); } this.transform.position = rect.position; this.transform.position = position; startPos = new Vector2(transform.localPosition.x + UnityEngine.Random.Range(-30, 30), transform.localPosition.y + UnityEngine.Random.Range(50, 100)); if (isAnimate) { Main/System/Equip/ItemsOnFloor.cs
@@ -141,7 +141,7 @@ continue; } item.Display(i, isAnimate, rect == null ? defaultDropRect : rect); item.Display(i, isAnimate, rect == null ? defaultDropRect.position : rect.position).Forget(); } } Main/System/Guild/GuildJoinWin.cs
@@ -76,7 +76,7 @@ noGuildTf.SetActive(false); guildListScroller.SetActive(true); var startCount = guildListScroller.GetNumberOfCells(); var startCount = guildListScroller.GetCellTotalCount(); if (startCount > GuildManager.Instance.pageIndexList.Count) { guildListScroller.Refresh(); Main/System/ItemTip/OwnMoneyCell.cs
@@ -20,11 +20,38 @@ { switch (moneyType) { // case 1: // { // //UIManager.Instance.OpenWindow<RechargeWin>(); // } // break; case 1: { if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge, true)) { RechargeManager.Instance.selectTabIndex = 1; if (UIManager.Instance.IsOpened<StoreBaseWin>()) { UIManager.Instance.GetUI<StoreBaseWin>().ClickFuncBtn(1); } else { UIManager.Instance.OpenWindow<StoreBaseWin>(1); } } } break; case 99: { if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge, true)) { RechargeManager.Instance.selectTabIndex = 0; if (UIManager.Instance.IsOpened<StoreBaseWin>()) { UIManager.Instance.GetUI<StoreBaseWin>().ClickFuncBtn(1); } else { UIManager.Instance.OpenWindow<StoreBaseWin>(1); } } } break; default: { ItemTipUtility.ShowMoneyTip(moneyType); Main/System/Main/FunctionsBaseWin.cs
@@ -111,4 +111,14 @@ { SelectBottomTab(index); } public void ClickFuncBtn(int index) { if (tabButtons[index].isLock) { return; } tabButtons[index].SelectBtn(); SelectBottomTab(index); } } Main/System/NewBieGuidance/NewBieCenter.cs
@@ -25,7 +25,7 @@ public bool inGuiding { // 当前有引导,并且不是暂停状态,则在引导中 get { return currentGuide != 0 && IsPauseStoryBattleState(); } get { return currentGuide != 0 && IsNeedRecord(currentGuide); } } List<int> allGuides = new List<int>(); @@ -312,29 +312,15 @@ } } public bool IsPauseStoryBattleState() //非0代表 可重复引导,且优先级低会被新引导替换,且不暂停主线战斗 public bool IsNeedRecord(int _id) { if (!UIManager.Instance.IsOpened<NewBieWin>()) return false; var stepConfig = ScriptableObjectLoader.LoadSoNewBieGuideStep(guideStep); if (!(stepConfig.guideType == GuideType.NewBie && stepConfig.clickCompleteNoMask)) var config = GuideConfig.Get(_id); if (config == null) { // 非强制引导不暂停战斗,如有具体需要可以增加字段 if (currentGuide == BattleManager.Instance.fightGuideID) { // 战斗引导中,不暂停 return false; } return true; return false; } return false; } bool IsNeedRecord(int _id) { return GuideConfig.Get(_id).NoRecord == 0; } Main/System/NewBieGuidance/NewBieWin.cs
@@ -75,6 +75,7 @@ m_GuideTalkRect.SetActive(false); m_ContainerDialogue.SetActive(false); m_NewBieMask.SetActive(false); NewBieCenter.Instance.currentGuide = 0; } protected override void OnClose() Main/System/Recharge/RechargeDJQCell.cs
New file @@ -0,0 +1,40 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class RechargeDJQCell : MonoBehaviour { [SerializeField] Transform firstTf; [SerializeField] Text firstNums; //首充获得的货币数量 [SerializeField] Image icon; [SerializeField] Text normalNums; //普通购买的货币数量 [SerializeField] Text priceText; [SerializeField] Button buyBtn; public void Display(int ctgID) { var config = CTGConfig.Get(ctgID); RechargeManager.Instance.TryGetRechargeCount(ctgID, out RechargeCount _rechargeCount); bool isFirstBuy = _rechargeCount.totalCount == 0; if (isFirstBuy) { firstTf.SetActive(true); firstNums.text = config.FirstGoldPaperPrize.ToString(); } else { firstTf.SetActive(false); } normalNums.text = (config.GainGold/100).ToString(); RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig); priceText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); icon.SetSprite(config.Icon); icon.SetNativeSize(); buyBtn.AddListener(() => { RechargeManager.Instance.CTG(orderInfoConfig); }); } } Main/System/Recharge/RechargeDJQCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: f825b789f0177764ca83eb5dc03bd806 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Recharge/RechargeDJQLineCell.cs
New file @@ -0,0 +1,27 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class RechargeDJQLineCell : CellView { [SerializeField] RechargeDJQCell[] cells; public void Display(int index, List<int> _list) { for (int i = 0; i < cells.Length; i++) { if (index + i < _list.Count) { cells[i].SetActive(true); cells[i].Display(_list[index + i]); } else { cells[i].SetActive(false); } } } } Main/System/Recharge/RechargeDJQLineCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 8f32da7b403e7e1498ac3ac51db72dba MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Recharge/RechargeGoldCell.cs
New file @@ -0,0 +1,45 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class RechargeGoldCell : MonoBehaviour { [SerializeField] Transform firstTf; [SerializeField] Text firstNums; //首充获得的货币数量 [SerializeField] Text firstNumsEx; [SerializeField] Image icon; [SerializeField] Text normalNums; //普通购买的货币数量 [SerializeField] Text priceText; [SerializeField] Button buyBtn; public void Display(int ctgID) { var config = CTGConfig.Get(ctgID); RechargeManager.Instance.TryGetRechargeCount(ctgID, out RechargeCount _rechargeCount); bool isFirstBuy = _rechargeCount.totalCount == 0; if (isFirstBuy) { firstTf.SetActive(true); normalNums.SetActive(false); firstNums.text = (config.GainGold + config.GainGoldPaper).ToString(); firstNumsEx.text = config.FirstGoldPaperPrize.ToString(); } else { firstTf.SetActive(false); normalNums.SetActive(true); normalNums.text = config.GainGold.ToString(); } RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig); priceText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); icon.SetSprite(config.Icon); icon.SetNativeSize(); buyBtn.AddListener(() => { RechargeManager.Instance.CTG(orderInfoConfig); }); } } Main/System/Recharge/RechargeGoldCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 0be1db6705e618b4a900f715a3d5ae1f MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Recharge/RechargeGoldLineCell.cs
New file @@ -0,0 +1,27 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class RechargeGoldLineCell : CellView { [SerializeField] RechargeGoldCell[] cells; public void Display(int index, List<int> _list) { for (int i = 0; i < cells.Length; i++) { if (index + i < _list.Count) { cells[i].SetActive(true); cells[i].Display(_list[index + i]); } else { cells[i].SetActive(false); } } } } Main/System/Recharge/RechargeGoldLineCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: f09634b105ffa4f428926296368c4af3 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Recharge/RechargeManager.UI.cs
New file @@ -0,0 +1,24 @@ using System.Collections.Generic; using UnityEngine.UI; using System.Linq; using LitJson; using System; public partial class RechargeManager : GameSystemManager<RechargeManager> { public int selectTabIndex; //0 点券 1 金币 public List<int> GetCTGIDListByType(int type) { var list = new List<int>(); foreach (var config in CTGConfig.GetValues()) { if (config.PayType == type) { list.Add(config.RecordID); } } return list; } } Main/System/Recharge/RechargeManager.UI.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 72ed47a97a6d77f498338aa6be3bba2b MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Recharge/RechargeManager.cs
@@ -7,7 +7,7 @@ using System.Linq; public class RechargeManager : GameSystemManager<RechargeManager> public partial class RechargeManager : GameSystemManager<RechargeManager> { private Dictionary<string, List<int>> m_CTGConfigDict = new Dictionary<string, List<int>>(); public List<int> voucherCTGList = new List<int>(); Main/System/Recharge/RechargeWin.cs
New file @@ -0,0 +1,133 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; //充值界面 public class RechargeWin : UIBase { [SerializeField] GroupButtonEx djqBtn; [SerializeField] GroupButtonEx goldBtn; [SerializeField] ScrollerController djqScroller; [SerializeField] ScrollerController goldScroller; [SerializeField] Transform djqInfo; List<int> _list = new List<int>(); protected override void InitComponent() { djqBtn.AddListener(() => { OnSelectFuncType(0); }); goldBtn.AddListener(() => { OnSelectFuncType(1); }); } protected override void OnPreOpen() { djqScroller.OnRefreshCell += OnDjqRefreshCell; goldScroller.OnRefreshCell += OnGoldRefreshCell; RechargeManager.Instance.rechargeCountEvent += RechargeEvent; if (RechargeManager.Instance.selectTabIndex == 0) { djqBtn.SelectBtn(); } else if (RechargeManager.Instance.selectTabIndex == 1) { goldBtn.SelectBtn(); } Display(); } protected override void OnPreClose() { djqScroller.OnRefreshCell -= OnDjqRefreshCell; goldScroller.OnRefreshCell -= OnGoldRefreshCell; RechargeManager.Instance.rechargeCountEvent -= RechargeEvent; } void RechargeEvent(int id) { Display(); } void Display() { CreateScroller(); } void CreateScroller() { if (RechargeManager.Instance.selectTabIndex == 0) { _list = RechargeManager.Instance.GetCTGIDListByType(17); djqScroller.SetActive(true); djqInfo.SetActive(true); goldScroller.SetActive(false); if (djqScroller.GetCellTotalCount() == 0) { djqScroller.Refresh(); for (int i = 0; i < _list.Count; i++) { if (i % 3 == 0) { djqScroller.AddCell(ScrollerDataType.Header,i); } } djqScroller.Restart(); } else { djqScroller.m_Scorller.RefreshActiveCellViews(); } } else if (RechargeManager.Instance.selectTabIndex == 1) { _list = RechargeManager.Instance.GetCTGIDListByType(2); djqScroller.SetActive(false); djqInfo.SetActive(false); goldScroller.SetActive(true); if (goldScroller.GetCellTotalCount() == 0) { goldScroller.Refresh(); for (int i = 0; i < _list.Count; i++) { if (i % 3 == 0) { goldScroller.AddCell(ScrollerDataType.Header, i); } } goldScroller.Restart(); } else { goldScroller.m_Scorller.RefreshActiveCellViews(); } } } void OnDjqRefreshCell(ScrollerDataType type, CellView cell) { var _cell = cell as RechargeDJQLineCell; _cell.Display(cell.index, _list); } void OnGoldRefreshCell(ScrollerDataType type, CellView cell) { var _cell = cell as RechargeGoldLineCell; _cell.Display(cell.index, _list); } void OnSelectFuncType(int index) { RechargeManager.Instance.selectTabIndex = index; Display(); } } Main/System/Recharge/RechargeWin.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: e2f8fee881a283c4f86b141b380dbcce MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Scroll/ScrollerController.cs
@@ -110,7 +110,7 @@ } // 获取总的Cell数目(含不显示的) public int GetNumberOfCells() public int GetCellTotalCount() { return _data.Count; } Main/System/Store/StoreBaseWin.cs
@@ -15,7 +15,7 @@ break; case 1: // 充值界面 currentSubUI = UIManager.Instance.OpenWindow<StoreWin>(); currentSubUI = UIManager.Instance.OpenWindow<RechargeWin>(); break; default: Debug.LogWarning("未知的标签索引: " + functionOrder);