using System; using cfg; using UnityEngine; using Luban; using SimpleJSON; namespace ZC { internal class ConfigManager : ManagerBase { Tables tables; public override void OnInit(params object[] data) { base.OnInit(); string gameConfDir = ""; // 替换为gen.bat中outputDataDir指向的目录 tables = new cfg.Tables(this.JX); var item = tables.TbItem.Get(10001); UnityEngine.Debug.Log($"tb id : {item.Id}, name: {item.Name}, desc: {item.Desc}"); var playerData = this.tables.TBPlayer.Get(10001); UnityEngine.Debug.Log($"playerData id : {playerData.Id}, name: {playerData.Name}, desc: {playerData.Desc}"); } private JSONNode JX(string arg) { string path = String.Empty; switch (arg) { case "item_tbitem": path = AssetConst.Assets_DemoGame_GameRes_Config_JSON_item_tbitem_json; break; case "tbplayer": path = AssetConst.Assets_DemoGame_GameRes_Config_JSON_tbplayer_json; break; default: break; } var textAsset = ResourcesLocalComponent.Instance.LoadAssetSync(path); return JSON.Parse(textAsset.text); } } public class AA { void A() { } } }