| | |
| | | using LitJson; |
| | | using System.Collections; |
| | | using System.IO; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | public class PackManager : GameSystemManager<PackManager> |
| | | { |
| | |
| | | |
| | | public int[] noRedpointComposeItemIDs; |
| | | |
| | | public override void Init() |
| | | public async override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | ParseConfig(); |
| | | await ParseConfig(); |
| | | //SysNotifyMgr.Instance.sysNotifyEvent += RefreshSysInfo; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | #region 玩家装备特殊逻辑 |
| | | void ParseConfig() |
| | | async UniTask ParseConfig() |
| | | { |
| | | |
| | | ParsePackConfigIni(); |
| | | await ParsePackConfigIni(); |
| | | autoUseItemIDs = JsonMapper.ToObject<int[]>(FuncConfigConfig.Get("AutoUseItem").Numerical1); |
| | | var config= FuncConfigConfig.Get("InitBagCellCount"); |
| | | initBagGridCount = int.Parse(config.Numerical1); |
| | |
| | | noRedpointComposeItemIDs = JsonMapper.ToObject<int[]>(config.Numerical1); |
| | | } |
| | | |
| | | void ParsePackConfigIni() |
| | | async UniTask ParsePackConfigIni() |
| | | { |
| | | string[] lines = LoadConfigIni("MapServerConfig"); |
| | | string[] lines = await LoadConfigIni("MapServerConfig.ini"); |
| | | foreach (string line in lines) |
| | | { |
| | | if (line.StartsWith("PackCnt") && line.Contains("=")) |
| | |
| | | } |
| | | } |
| | | |
| | | public string[] LoadConfigIni(string name) |
| | | public async UniTask<string[]> LoadConfigIni(string name) |
| | | { |
| | | string path = string.Empty; |
| | | #if UNITY_EDITOR |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER + "/" + name + ".ini"; |
| | | } |
| | | else |
| | | #endif |
| | | { |
| | | //从服务端拷贝是ini,打包用txt统一处理 |
| | | path = AssetVersionUtility.GetAssetFilePath($"Config/{name}.txt"); |
| | | } |
| | | // string path = string.Empty; |
| | | // #if UNITY_EDITOR |
| | | // if (!AssetSource.isUseAssetBundle) |
| | | // { |
| | | // path = ResourcesPath.CONFIG_FODLER + "/" + name + ".ini"; |
| | | // } |
| | | // else |
| | | // #endif |
| | | // { |
| | | // //从服务端拷贝是ini,打包用txt统一处理 |
| | | // path = AssetVersionUtility.GetAssetFilePath($"Config/{name}.txt"); |
| | | // } |
| | | |
| | | return File.ReadAllLines(path); |
| | | return await ResManager.Instance.LoadConfigAsync(name, false); |
| | | |
| | | // return File.ReadAllLines(path); |
| | | } |
| | | |
| | | public int GetCanBuyPackGirdCount(PackType type) |
| | |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | ItemModel itemModel = null; |
| | | itemGUIDDict.TryGetValue(guid, out itemModel); |
| | | return itemModel; |