| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | using System; |
| | | |
| | | |
| | | public class MainLevelManager : GameSystemManager<MainLevelManager> |
| | | { |
| | | |
| | | public Dictionary<int, int> m_DailyBootyDict = new Dictionary<int, int>(); |
| | | public event Action OnUpdateDayBooty; |
| | | public override void Init() |
| | | { |
| | | base.Init(); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | base.Release(); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | |
| | | private void OnBeforePlayerDataInitialize() |
| | | { |
| | | m_DailyBootyDict.Clear(); |
| | | } |
| | | |
| | | public void UpdateDayDropBooty(HB123_tagSCDropBootyInfo netPack) |
| | | { |
| | | for (int i = 0; i < netPack.Count; i++) |
| | | { |
| | | m_DailyBootyDict[(int)netPack.DropBootyList[i].ItemID] = (int)netPack.DropBootyList[i].TodayDropCnt; |
| | | } |
| | | OnUpdateDayBooty?.Invoke(); |
| | | } |
| | | |
| | | public bool CanChallengeBoss() |
| | | { |
| | | //最后一波通过,且当前波还是最后一波;倒退只倒退波不会倒退关卡 |
| | | if (PlayerDatas.Instance.baseData.ExAttr2 != PlayerDatas.Instance.baseData.ExAttr1) |
| | | { |
| | | return false; |
| | | } |
| | | var value = PlayerDatas.Instance.baseData.ExAttr2; |
| | | var chapterID = value / 10000; |
| | | var levelNum = value % 10000 / 100; |
| | | var waveID = value % 100; |
| | | |
| | | var config = MainLevelConfig.GetMainLevelConfig(chapterID, levelNum); |
| | | if (waveID < MainLevelConfig.GetwaveCount(config)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | } |