52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
|
using System;
|
|||
|
using cfg;
|
|||
|
using UnityEngine;
|
|||
|
using Luban;
|
|||
|
using SimpleJSON;
|
|||
|
|
|||
|
namespace ZC
|
|||
|
{
|
|||
|
internal class ConfigManager : ManagerBase<ConfigManager>
|
|||
|
{
|
|||
|
Tables tables;
|
|||
|
|
|||
|
public override void OnInit()
|
|||
|
{
|
|||
|
base.OnInit();
|
|||
|
string gameConfDir = "<outputDataDir>"; // 替换为gen.bat中outputDataDir指向的目录
|
|||
|
// string root = AssetConst.Assets_DemoGame_GameRes_Config_JSON_tbplayer_json;
|
|||
|
// ResourcesLocalComponent.Instance.LoadAssetSync<TextAsset>($"");
|
|||
|
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<TextAsset>(path);
|
|||
|
return JSON.Parse(textAsset.text);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public class AA
|
|||
|
{
|
|||
|
void A()
|
|||
|
{
|
|||
|
}
|
|||
|
}
|
|||
|
}
|