拓展自定义鲁班加载配置,支持懒加载 默认使用懒加载,未使用的配置不会载入内存

拓展自定义鲁班加载配置,支持懒加载 默认使用懒加载,未使用的配置不会载入内存
This commit is contained in:
ALEXTANG
2023-08-17 23:07:07 +08:00
parent bf73ce333b
commit e071c20214
17 changed files with 1123 additions and 216 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6a824de3af698c34bb4343dbb911498b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -7,7 +7,7 @@ using UnityEngine;
/// <summary> /// <summary>
/// 配置加载器。 /// 配置加载器。
/// </summary> /// </summary>
public class ConfigLoader:Singleton<ConfigLoader> public class ConfigLoader : Singleton<ConfigLoader>
{ {
private bool _init = false; private bool _init = false;
@@ -21,6 +21,7 @@ public class ConfigLoader:Singleton<ConfigLoader>
{ {
Load(); Load();
} }
return _tables; return _tables;
} }
} }
@@ -30,7 +31,7 @@ public class ConfigLoader:Singleton<ConfigLoader>
/// </summary> /// </summary>
public void Load() public void Load()
{ {
_tables = new Tables(LoadByteBuf); _tables = new Tables(LoadIdxByteBuf, LoadByteBuf);
_init = true; _init = true;
} }
@@ -41,7 +42,19 @@ public class ConfigLoader:Singleton<ConfigLoader>
/// <returns>ByteBuf</returns> /// <returns>ByteBuf</returns>
private ByteBuf LoadByteBuf(string file) private ByteBuf LoadByteBuf(string file)
{ {
var textAssets = GameModule.Resource.LoadAsset<TextAsset>($"{SettingsUtils.FrameworkGlobalSettings.ConfigFolderName}{file}.bytes"); var textAssets = GameModule.Resource.LoadAsset<TextAsset>(file);
byte[] ret = textAssets.bytes;
return new ByteBuf(ret);
}
/// <summary>
/// 加载懒加载Index。
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
private ByteBuf LoadIdxByteBuf(string file)
{
var textAssets = GameModule.Resource.LoadAsset<TextAsset>($"Idx_{file}");
byte[] ret = textAssets.bytes; byte[] ret = textAssets.bytes;
return new ByteBuf(ret); return new ByteBuf(ret);
} }
@@ -49,16 +62,11 @@ public class ConfigLoader:Singleton<ConfigLoader>
public class ConfigSystem : BaseLogicSys<ConfigSystem> public class ConfigSystem : BaseLogicSys<ConfigSystem>
{ {
public Tables Tables => ConfigLoader.Instance.Tables;
public override bool OnInit() public override bool OnInit()
{ {
Log.Warning("ConfigSystem OnInit"); Log.Warning("ConfigSystem OnInit");
InitConfig();
return base.OnInit(); return base.OnInit();
} }
private void InitConfig()
{
ConfigLoader.Instance.Load();
}
} }

View File

@@ -7,57 +7,120 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using Bright.Serialization; using Bright.Serialization;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace GameConfig.Battle namespace GameConfig.Battle
{ {
public partial class TbBuff public partial class TbBuff
{
private readonly Dictionary<int, Battle.BuffConfig> _dataMap;
private readonly List<Battle.BuffConfig> _dataList;
public TbBuff(ByteBuf _buf)
{ {
_dataMap = new Dictionary<int, Battle.BuffConfig>(); public static TbBuff Instance { get; private set; }
_dataList = new List<Battle.BuffConfig>(); private bool _readAll = false;
private Dictionary<int, Battle.BuffConfig> _dataMap;
private List<Battle.BuffConfig> _dataList;
public Dictionary<int, Battle.BuffConfig> DataMap
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataMap;
}
}
public List<Battle.BuffConfig> DataList
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataList;
}
}
private Dictionary<int,int> _indexMap;
public List<int> Indexes;
private System.Func<ByteBuf> _dataLoader;
for(int n = _buf.ReadSize() ; n > 0 ; --n) private void ReadAll()
{
_dataList.Clear();
foreach(var index in Indexes)
{
var v = Get(index);
_dataMap[index] = v;
_dataList.Add(v);
}
}
public TbBuff(ByteBuf _buf, string _tbName, System.Func<string, ByteBuf> _loader)
{
Instance = this;
_dataMap = new Dictionary<int, Battle.BuffConfig>();
_dataList = new List<Battle.BuffConfig>();
_indexMap = new Dictionary<int, int>();
_dataLoader = new System.Func<ByteBuf>(() => _loader(_tbName));
for (int n = _buf.ReadSize(); n > 0; --n)
{
int key;
key = _buf.ReadInt();
int index = _buf.ReadInt();
_indexMap[key] = index;
}
Indexes = _indexMap.Keys.ToList();
PostInit();
}
public Battle.BuffConfig this[int key] => Get(key);
public Battle.BuffConfig Get(int key)
{ {
Battle.BuffConfig _v; Battle.BuffConfig _v;
if(_dataMap.TryGetValue(key, out _v))
{
return _v;
}
ResetByteBuf(_indexMap[key]);
_v = Battle.BuffConfig.DeserializeBuffConfig(_buf); _v = Battle.BuffConfig.DeserializeBuffConfig(_buf);
_dataList.Add(_v); _dataMap[_v.BuffID] = _v;
_dataMap.Add(_v.BuffID, _v); _v.Resolve(tables);
if(_indexMap.Count == _dataMap.Count)
{
_buf = null;
}
return _v;
} }
PostInit(); public Battle.BuffConfig GetOrDefault(int key)
}
public Dictionary<int, Battle.BuffConfig> DataMap => _dataMap;
public List<Battle.BuffConfig> DataList => _dataList;
public Battle.BuffConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public Battle.BuffConfig Get(int key) => _dataMap[key];
public Battle.BuffConfig this[int key] => _dataMap[key];
public void Resolve(Dictionary<string, object> _tables)
{
foreach(var v in _dataList)
{ {
v.Resolve(_tables); if(_indexMap.TryGetValue(key,out var _))
{
return Get(key);
}
return null;
} }
PostResolve();
}
public void TranslateText(System.Func<string, string, string> translator) private void ResetByteBuf(int readerInex = 0)
{
foreach(var v in _dataList)
{ {
v.TranslateText(translator); if( _buf == null)
{
if (_buf == null)
{
_buf = _dataLoader();
}
}
_buf.ReaderIndex = readerInex;
} }
private ByteBuf _buf = null;
private Dictionary<string, object> tables;
public void CacheTables(Dictionary<string, object> _tables)
{
tables = _tables;
}
partial void PostInit();
} }
partial void PostInit();
partial void PostResolve();
}
} }

View File

@@ -7,57 +7,120 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using Bright.Serialization; using Bright.Serialization;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace GameConfig.Battle namespace GameConfig.Battle
{ {
public partial class TbBuffAttr public partial class TbBuffAttr
{
private readonly Dictionary<int, Battle.BuffAttrConfig> _dataMap;
private readonly List<Battle.BuffAttrConfig> _dataList;
public TbBuffAttr(ByteBuf _buf)
{ {
_dataMap = new Dictionary<int, Battle.BuffAttrConfig>(); public static TbBuffAttr Instance { get; private set; }
_dataList = new List<Battle.BuffAttrConfig>(); private bool _readAll = false;
private Dictionary<int, Battle.BuffAttrConfig> _dataMap;
private List<Battle.BuffAttrConfig> _dataList;
public Dictionary<int, Battle.BuffAttrConfig> DataMap
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataMap;
}
}
public List<Battle.BuffAttrConfig> DataList
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataList;
}
}
private Dictionary<int,int> _indexMap;
public List<int> Indexes;
private System.Func<ByteBuf> _dataLoader;
for(int n = _buf.ReadSize() ; n > 0 ; --n) private void ReadAll()
{
_dataList.Clear();
foreach(var index in Indexes)
{
var v = Get(index);
_dataMap[index] = v;
_dataList.Add(v);
}
}
public TbBuffAttr(ByteBuf _buf, string _tbName, System.Func<string, ByteBuf> _loader)
{
Instance = this;
_dataMap = new Dictionary<int, Battle.BuffAttrConfig>();
_dataList = new List<Battle.BuffAttrConfig>();
_indexMap = new Dictionary<int, int>();
_dataLoader = new System.Func<ByteBuf>(() => _loader(_tbName));
for (int n = _buf.ReadSize(); n > 0; --n)
{
int key;
key = _buf.ReadInt();
int index = _buf.ReadInt();
_indexMap[key] = index;
}
Indexes = _indexMap.Keys.ToList();
PostInit();
}
public Battle.BuffAttrConfig this[int key] => Get(key);
public Battle.BuffAttrConfig Get(int key)
{ {
Battle.BuffAttrConfig _v; Battle.BuffAttrConfig _v;
if(_dataMap.TryGetValue(key, out _v))
{
return _v;
}
ResetByteBuf(_indexMap[key]);
_v = Battle.BuffAttrConfig.DeserializeBuffAttrConfig(_buf); _v = Battle.BuffAttrConfig.DeserializeBuffAttrConfig(_buf);
_dataList.Add(_v); _dataMap[_v.BuffID] = _v;
_dataMap.Add(_v.BuffID, _v); _v.Resolve(tables);
if(_indexMap.Count == _dataMap.Count)
{
_buf = null;
}
return _v;
} }
PostInit(); public Battle.BuffAttrConfig GetOrDefault(int key)
}
public Dictionary<int, Battle.BuffAttrConfig> DataMap => _dataMap;
public List<Battle.BuffAttrConfig> DataList => _dataList;
public Battle.BuffAttrConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public Battle.BuffAttrConfig Get(int key) => _dataMap[key];
public Battle.BuffAttrConfig this[int key] => _dataMap[key];
public void Resolve(Dictionary<string, object> _tables)
{
foreach(var v in _dataList)
{ {
v.Resolve(_tables); if(_indexMap.TryGetValue(key,out var _))
{
return Get(key);
}
return null;
} }
PostResolve();
}
public void TranslateText(System.Func<string, string, string> translator) private void ResetByteBuf(int readerInex = 0)
{
foreach(var v in _dataList)
{ {
v.TranslateText(translator); if( _buf == null)
{
if (_buf == null)
{
_buf = _dataLoader();
}
}
_buf.ReaderIndex = readerInex;
} }
private ByteBuf _buf = null;
private Dictionary<string, object> tables;
public void CacheTables(Dictionary<string, object> _tables)
{
tables = _tables;
}
partial void PostInit();
} }
partial void PostInit();
partial void PostResolve();
}
} }

View File

@@ -7,57 +7,120 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using Bright.Serialization; using Bright.Serialization;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace GameConfig.Battle namespace GameConfig.Battle
{ {
public partial class TbSkill public partial class TbSkill
{
private readonly Dictionary<int, Battle.SkillBaseConfig> _dataMap;
private readonly List<Battle.SkillBaseConfig> _dataList;
public TbSkill(ByteBuf _buf)
{ {
_dataMap = new Dictionary<int, Battle.SkillBaseConfig>(); public static TbSkill Instance { get; private set; }
_dataList = new List<Battle.SkillBaseConfig>(); private bool _readAll = false;
private Dictionary<int, Battle.SkillBaseConfig> _dataMap;
private List<Battle.SkillBaseConfig> _dataList;
public Dictionary<int, Battle.SkillBaseConfig> DataMap
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataMap;
}
}
public List<Battle.SkillBaseConfig> DataList
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataList;
}
}
private Dictionary<int,int> _indexMap;
public List<int> Indexes;
private System.Func<ByteBuf> _dataLoader;
for(int n = _buf.ReadSize() ; n > 0 ; --n) private void ReadAll()
{
_dataList.Clear();
foreach(var index in Indexes)
{
var v = Get(index);
_dataMap[index] = v;
_dataList.Add(v);
}
}
public TbSkill(ByteBuf _buf, string _tbName, System.Func<string, ByteBuf> _loader)
{
Instance = this;
_dataMap = new Dictionary<int, Battle.SkillBaseConfig>();
_dataList = new List<Battle.SkillBaseConfig>();
_indexMap = new Dictionary<int, int>();
_dataLoader = new System.Func<ByteBuf>(() => _loader(_tbName));
for (int n = _buf.ReadSize(); n > 0; --n)
{
int key;
key = _buf.ReadInt();
int index = _buf.ReadInt();
_indexMap[key] = index;
}
Indexes = _indexMap.Keys.ToList();
PostInit();
}
public Battle.SkillBaseConfig this[int key] => Get(key);
public Battle.SkillBaseConfig Get(int key)
{ {
Battle.SkillBaseConfig _v; Battle.SkillBaseConfig _v;
if(_dataMap.TryGetValue(key, out _v))
{
return _v;
}
ResetByteBuf(_indexMap[key]);
_v = Battle.SkillBaseConfig.DeserializeSkillBaseConfig(_buf); _v = Battle.SkillBaseConfig.DeserializeSkillBaseConfig(_buf);
_dataList.Add(_v); _dataMap[_v.Id] = _v;
_dataMap.Add(_v.Id, _v); _v.Resolve(tables);
if(_indexMap.Count == _dataMap.Count)
{
_buf = null;
}
return _v;
} }
PostInit(); public Battle.SkillBaseConfig GetOrDefault(int key)
}
public Dictionary<int, Battle.SkillBaseConfig> DataMap => _dataMap;
public List<Battle.SkillBaseConfig> DataList => _dataList;
public Battle.SkillBaseConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public Battle.SkillBaseConfig Get(int key) => _dataMap[key];
public Battle.SkillBaseConfig this[int key] => _dataMap[key];
public void Resolve(Dictionary<string, object> _tables)
{
foreach(var v in _dataList)
{ {
v.Resolve(_tables); if(_indexMap.TryGetValue(key,out var _))
{
return Get(key);
}
return null;
} }
PostResolve();
}
public void TranslateText(System.Func<string, string, string> translator) private void ResetByteBuf(int readerInex = 0)
{
foreach(var v in _dataList)
{ {
v.TranslateText(translator); if( _buf == null)
{
if (_buf == null)
{
_buf = _dataLoader();
}
}
_buf.ReaderIndex = readerInex;
} }
private ByteBuf _buf = null;
private Dictionary<string, object> tables;
public void CacheTables(Dictionary<string, object> _tables)
{
tables = _tables;
}
partial void PostInit();
} }
partial void PostInit();
partial void PostResolve();
}
} }

View File

@@ -8,9 +8,9 @@
using Bright.Serialization; using Bright.Serialization;
namespace GameConfig namespace GameConfig
{ {
public partial class Tables public partial class Tables
{ {
public item.TbItem TbItem {get; } public item.TbItem TbItem {get; }
@@ -18,36 +18,26 @@ public partial class Tables
public Battle.TbBuff TbBuff {get; } public Battle.TbBuff TbBuff {get; }
public Battle.TbBuffAttr TbBuffAttr {get; } public Battle.TbBuffAttr TbBuffAttr {get; }
public Tables(System.Func<string, ByteBuf> loader) public Tables(System.Func<string, ByteBuf> idxLoader,System.Func<string, ByteBuf> dataLoader)
{ {
var tables = new System.Collections.Generic.Dictionary<string, object>(); var tables = new System.Collections.Generic.Dictionary<string, object>();
TbItem = new item.TbItem(loader("item_tbitem")); TbItem = new item.TbItem(idxLoader("item_tbitem"),"item_tbitem",dataLoader);
tables.Add("item.TbItem", TbItem); tables.Add("item.TbItem", TbItem);
TbSkill = new Battle.TbSkill(loader("battle_tbskill")); TbSkill = new Battle.TbSkill(idxLoader("battle_tbskill"),"battle_tbskill",dataLoader);
tables.Add("Battle.TbSkill", TbSkill); tables.Add("Battle.TbSkill", TbSkill);
TbBuff = new Battle.TbBuff(loader("battle_tbbuff")); TbBuff = new Battle.TbBuff(idxLoader("battle_tbbuff"),"battle_tbbuff",dataLoader);
tables.Add("Battle.TbBuff", TbBuff); tables.Add("Battle.TbBuff", TbBuff);
TbBuffAttr = new Battle.TbBuffAttr(loader("battle_tbbuffattr")); TbBuffAttr = new Battle.TbBuffAttr(idxLoader("battle_tbbuffattr"),"battle_tbbuffattr",dataLoader);
tables.Add("Battle.TbBuffAttr", TbBuffAttr); tables.Add("Battle.TbBuffAttr", TbBuffAttr);
PostInit(); PostInit();
TbItem.Resolve(tables); TbItem.CacheTables(tables);
TbSkill.Resolve(tables); TbSkill.CacheTables(tables);
TbBuff.Resolve(tables); TbBuff.CacheTables(tables);
TbBuffAttr.Resolve(tables); TbBuffAttr.CacheTables(tables);
PostResolve();
}
public void TranslateText(System.Func<string, string, string> translator)
{
TbItem.TranslateText(translator);
TbSkill.TranslateText(translator);
TbBuff.TranslateText(translator);
TbBuffAttr.TranslateText(translator);
} }
partial void PostInit(); partial void PostInit();
partial void PostResolve();
} }
} }

View File

@@ -22,7 +22,6 @@ public sealed partial class Item : Bright.Config.BeanBase
UpgradeToItemId = _buf.ReadInt(); UpgradeToItemId = _buf.ReadInt();
if(_buf.ReadBool()){ ExpireTime = _buf.ReadInt(); } else { ExpireTime = null; } if(_buf.ReadBool()){ ExpireTime = _buf.ReadInt(); } else { ExpireTime = null; }
BatchUseable = _buf.ReadBool(); BatchUseable = _buf.ReadBool();
Quality = (item.EQuality)_buf.ReadInt();
ExchangeStream = item.ItemExchange.DeserializeItemExchange(_buf); ExchangeStream = item.ItemExchange.DeserializeItemExchange(_buf);
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);ExchangeList = new System.Collections.Generic.List<item.ItemExchange>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { item.ItemExchange _e0; _e0 = item.ItemExchange.DeserializeItemExchange(_buf); ExchangeList.Add(_e0);}} {int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);ExchangeList = new System.Collections.Generic.List<item.ItemExchange>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { item.ItemExchange _e0; _e0 = item.ItemExchange.DeserializeItemExchange(_buf); ExchangeList.Add(_e0);}}
ExchangeColumn = item.ItemExchange.DeserializeItemExchange(_buf); ExchangeColumn = item.ItemExchange.DeserializeItemExchange(_buf);
@@ -64,10 +63,6 @@ public sealed partial class Item : Bright.Config.BeanBase
/// </summary> /// </summary>
public bool BatchUseable { get; private set; } public bool BatchUseable { get; private set; }
/// <summary> /// <summary>
/// 品质
/// </summary>
public item.EQuality Quality { get; private set; }
/// <summary>
/// 道具兑换配置 /// 道具兑换配置
/// </summary> /// </summary>
public item.ItemExchange ExchangeStream { get; private set; } public item.ItemExchange ExchangeStream { get; private set; }
@@ -106,7 +101,6 @@ public sealed partial class Item : Bright.Config.BeanBase
+ "UpgradeToItemId:" + UpgradeToItemId + "," + "UpgradeToItemId:" + UpgradeToItemId + ","
+ "ExpireTime:" + ExpireTime + "," + "ExpireTime:" + ExpireTime + ","
+ "BatchUseable:" + BatchUseable + "," + "BatchUseable:" + BatchUseable + ","
+ "Quality:" + Quality + ","
+ "ExchangeStream:" + ExchangeStream + "," + "ExchangeStream:" + ExchangeStream + ","
+ "ExchangeList:" + Bright.Common.StringUtil.CollectionToString(ExchangeList) + "," + "ExchangeList:" + Bright.Common.StringUtil.CollectionToString(ExchangeList) + ","
+ "ExchangeColumn:" + ExchangeColumn + "," + "ExchangeColumn:" + ExchangeColumn + ","

View File

@@ -7,57 +7,120 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using Bright.Serialization; using Bright.Serialization;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace GameConfig.item namespace GameConfig.item
{ {
public partial class TbItem public partial class TbItem
{
private readonly Dictionary<int, item.Item> _dataMap;
private readonly List<item.Item> _dataList;
public TbItem(ByteBuf _buf)
{ {
_dataMap = new Dictionary<int, item.Item>(); public static TbItem Instance { get; private set; }
_dataList = new List<item.Item>(); private bool _readAll = false;
private Dictionary<int, item.Item> _dataMap;
private List<item.Item> _dataList;
public Dictionary<int, item.Item> DataMap
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataMap;
}
}
public List<item.Item> DataList
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataList;
}
}
private Dictionary<int,int> _indexMap;
public List<int> Indexes;
private System.Func<ByteBuf> _dataLoader;
for(int n = _buf.ReadSize() ; n > 0 ; --n) private void ReadAll()
{
_dataList.Clear();
foreach(var index in Indexes)
{
var v = Get(index);
_dataMap[index] = v;
_dataList.Add(v);
}
}
public TbItem(ByteBuf _buf, string _tbName, System.Func<string, ByteBuf> _loader)
{
Instance = this;
_dataMap = new Dictionary<int, item.Item>();
_dataList = new List<item.Item>();
_indexMap = new Dictionary<int, int>();
_dataLoader = new System.Func<ByteBuf>(() => _loader(_tbName));
for (int n = _buf.ReadSize(); n > 0; --n)
{
int key;
key = _buf.ReadInt();
int index = _buf.ReadInt();
_indexMap[key] = index;
}
Indexes = _indexMap.Keys.ToList();
PostInit();
}
public item.Item this[int key] => Get(key);
public item.Item Get(int key)
{ {
item.Item _v; item.Item _v;
if(_dataMap.TryGetValue(key, out _v))
{
return _v;
}
ResetByteBuf(_indexMap[key]);
_v = item.Item.DeserializeItem(_buf); _v = item.Item.DeserializeItem(_buf);
_dataList.Add(_v); _dataMap[_v.Id] = _v;
_dataMap.Add(_v.Id, _v); _v.Resolve(tables);
if(_indexMap.Count == _dataMap.Count)
{
_buf = null;
}
return _v;
} }
PostInit(); public item.Item GetOrDefault(int key)
}
public Dictionary<int, item.Item> DataMap => _dataMap;
public List<item.Item> DataList => _dataList;
public item.Item GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public item.Item Get(int key) => _dataMap[key];
public item.Item this[int key] => _dataMap[key];
public void Resolve(Dictionary<string, object> _tables)
{
foreach(var v in _dataList)
{ {
v.Resolve(_tables); if(_indexMap.TryGetValue(key,out var _))
{
return Get(key);
}
return null;
} }
PostResolve();
}
public void TranslateText(System.Func<string, string, string> translator) private void ResetByteBuf(int readerInex = 0)
{
foreach(var v in _dataList)
{ {
v.TranslateText(translator); if( _buf == null)
{
if (_buf == null)
{
_buf = _dataLoader();
}
}
_buf.ReaderIndex = readerInex;
} }
private ByteBuf _buf = null;
private Dictionary<string, object> tables;
public void CacheTables(Dictionary<string, object> _tables)
{
tables = _tables;
}
partial void PostInit();
} }
partial void PostInit();
partial void PostResolve();
}
} }

View File

@@ -7,7 +7,7 @@ using UnityEngine;
/// <summary> /// <summary>
/// 配置加载器。 /// 配置加载器。
/// </summary> /// </summary>
public class ConfigLoader:Singleton<ConfigLoader> public class ConfigLoader : Singleton<ConfigLoader>
{ {
private bool _init = false; private bool _init = false;
@@ -41,7 +41,7 @@ public class ConfigLoader:Singleton<ConfigLoader>
/// <returns>ByteBuf</returns> /// <returns>ByteBuf</returns>
private ByteBuf LoadByteBuf(string file) private ByteBuf LoadByteBuf(string file)
{ {
var textAssets = GameModule.Resource.LoadAsset<TextAsset>($"{SettingsUtils.FrameworkGlobalSettings.ConfigFolderName}{file}.bytes"); var textAssets = GameModule.Resource.LoadAsset<TextAsset>(file);
byte[] ret = textAssets.bytes; byte[] ret = textAssets.bytes;
return new ByteBuf(ret); return new ByteBuf(ret);
} }
@@ -49,6 +49,8 @@ public class ConfigLoader:Singleton<ConfigLoader>
public class ConfigSystem : BaseLogicSys<ConfigSystem> public class ConfigSystem : BaseLogicSys<ConfigSystem>
{ {
public Tables Tables => ConfigLoader.Instance.Tables;
public override bool OnInit() public override bool OnInit()
{ {
Log.Warning("ConfigSystem OnInit"); Log.Warning("ConfigSystem OnInit");

View File

@@ -0,0 +1,72 @@
using Bright.Serialization;
using GameBase;
using GameConfig;
using TEngine;
using UnityEngine;
/// <summary>
/// 配置加载器。
/// </summary>
public class ConfigLoader : Singleton<ConfigLoader>
{
private bool _init = false;
private Tables _tables;
public Tables Tables
{
get
{
if (!_init)
{
Load();
}
return _tables;
}
}
/// <summary>
/// 加载配置。
/// </summary>
public void Load()
{
_tables = new Tables(LoadIdxByteBuf, LoadByteBuf);
_init = true;
}
/// <summary>
/// 加载二进制配置。
/// </summary>
/// <param name="file">FileName</param>
/// <returns>ByteBuf</returns>
private ByteBuf LoadByteBuf(string file)
{
var textAssets = GameModule.Resource.LoadAsset<TextAsset>(file);
byte[] ret = textAssets.bytes;
return new ByteBuf(ret);
}
/// <summary>
/// 加载懒加载Index。
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
private ByteBuf LoadIdxByteBuf(string file)
{
var textAssets = GameModule.Resource.LoadAsset<TextAsset>($"Idx_{file}");
byte[] ret = textAssets.bytes;
return new ByteBuf(ret);
}
}
public class ConfigSystem : BaseLogicSys<ConfigSystem>
{
public Tables Tables => ConfigLoader.Instance.Tables;
public override bool OnInit()
{
Log.Warning("ConfigSystem OnInit");
return base.OnInit();
}
}

View File

@@ -0,0 +1,87 @@
using Bright.Serialization;
using System.Collections.Generic;
{{
name = x.name
parent_def_type = x.parent_def_type
export_fields = x.export_fields
hierarchy_export_fields = x.hierarchy_export_fields
}}
namespace {{x.namespace_with_top_module}}
{
{{~if x.comment != '' ~}}
/// <summary>
/// {{x.escape_comment}}
/// </summary>
{{~end~}}
public {{x.cs_class_modifier}} partial class {{name}} : {{if parent_def_type}} {{x.parent}} {{else}} Bright.Config.BeanBase {{end}}
{
public {{name}}(ByteBuf _buf) {{if parent_def_type}} : base(_buf) {{end}}
{
{{~ for field in export_fields ~}}
{{cs_deserialize '_buf' field.convention_name field.ctype}}
{{~if field.index_field~}}
foreach(var _v in {{field.convention_name}})
{
{{field.convention_name}}_Index.Add(_v.{{field.index_field.convention_name}}, _v);
}
{{~end~}}
{{~end~}}
PostInit();
}
public static {{name}} Deserialize{{name}}(ByteBuf _buf)
{
{{~if x.is_abstract_type~}}
switch (_buf.ReadInt())
{
{{~for child in x.hierarchy_not_abstract_children~}}
case {{child.full_name}}.__ID__: return new {{child.full_name}}(_buf);
{{~end~}}
default: throw new SerializationException();
}
{{~else~}}
return new {{x.full_name}}(_buf);
{{~end~}}
}
{{~ for field in export_fields ~}}
{{~if field.comment != '' ~}}
/// <summary>
/// {{field.escape_comment}}
/// </summary>
{{~end~}}
public {{cs_define_type field.ctype}} {{field.convention_name}} { get; private set; }
{{~if field.index_field~}}
public readonly Dictionary<{{cs_define_type field.index_field.ctype}}, {{cs_define_type field.ctype.element_type}}> {{field.convention_name}}_Index = new Dictionary<{{cs_define_type field.index_field.ctype}}, {{cs_define_type field.ctype.element_type}}>();
{{~end~}}
{{~if field.gen_ref~}}
public {{field.cs_ref_validator_define}}
{{~end~}}
{{~if (gen_datetime_mills field.ctype) ~}}
public long {{field.convention_name}}_Millis => {{field.convention_name}} * 1000L;
{{~end~}}
{{~if field.gen_text_key~}}
public {{cs_define_text_key_field field}} { get; }
{{~end~}}
{{~end~}}
{{~if !x.is_abstract_type~}}
public const int __ID__ = {{x.id}};
public override int GetTypeId() => __ID__;
{{~end~}}
public override string ToString()
{
return "{{full_name}}{ "
{{~for field in hierarchy_export_fields ~}}
+ "{{field.convention_name}}:" + {{cs_to_string field.convention_name field.ctype}} + ","
{{~end~}}
+ "}";
}
partial void PostInit();
}
}

View File

@@ -0,0 +1,413 @@
using Bright.Serialization;
using System.Collections.Generic;
using System.Linq;
namespace {{x.namespace_with_top_module}}
{
{{
name = x.name
key_type = x.key_ttype
key_type1 = x.key_ttype1
key_type2 = x.key_ttype2
value_type = x.value_ttype
}}
{{~if x.comment != '' ~}}
/// <summary>
/// {{x.escape_comment}}
/// </summary>
{{~end~}}
public partial class {{name}}
{
public static {{name}} Instance { get; private set; }
{{~if x.is_map_table ~}}
private bool _readAll = false;
private Dictionary<{{cs_define_type key_type}}, {{cs_define_type value_type}}> _dataMap;
private List<{{cs_define_type value_type}}> _dataList;
public Dictionary<{{cs_define_type key_type}}, {{cs_define_type value_type}}> DataMap
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataMap;
}
}
public List<{{cs_define_type value_type}}> DataList
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataList;
}
}
private Dictionary<{{cs_define_type key_type}},int> _indexMap;
public List<{{cs_define_type key_type}}> Indexes;
private System.Func<ByteBuf> _dataLoader;
private void ReadAll()
{
_dataList.Clear();
foreach(var index in Indexes)
{
var v = Get(index);
_dataMap[index] = v;
_dataList.Add(v);
}
}
public {{name}}(ByteBuf _buf, string _tbName, System.Func<string, ByteBuf> _loader)
{
Instance = this;
_dataMap = new Dictionary<{{cs_define_type key_type}}, {{cs_define_type value_type}}>();
_dataList = new List<{{cs_define_type value_type}}>();
_indexMap = new Dictionary<{{cs_define_type key_type}}, int>();
_dataLoader = new System.Func<ByteBuf>(() => _loader(_tbName));
for (int n = _buf.ReadSize(); n > 0; --n)
{
{{cs_define_type key_type}} key;
{{cs_deserialize '_buf' 'key' key_type}}
int index = _buf.ReadInt();
_indexMap[key] = index;
}
Indexes = _indexMap.Keys.ToList();
PostInit();
}
{{~if value_type.is_dynamic~}}
public T GetOrDefaultAs<T>({{cs_define_type key_type}} key) where T : {{cs_define_type value_type}}
{
if(_indexMap.TryGetValue(key,out var _))
{
return (T)Get(key);
}
return default(T);
}
public T GetAs<T>({{cs_define_type key_type}} key) where T : {{cs_define_type value_type}} => (T)Get(key);
{{~end~}}
public {{cs_define_type value_type}} this[{{cs_define_type key_type}} key] => Get(key);
public {{cs_define_type value_type}} Get({{cs_define_type key_type}} key)
{
{{cs_define_type value_type}} _v;
if(_dataMap.TryGetValue(key, out _v))
{
return _v;
}
ResetByteBuf(_indexMap[key]);
{{cs_deserialize '_buf' '_v' value_type}}
_dataMap[_v.{{x.index_field.convention_name}}] = _v;
_v.Resolve(tables);
if(_indexMap.Count == _dataMap.Count)
{
_buf = null;
}
return _v;
}
public {{cs_define_type value_type}} GetOrDefault({{cs_define_type key_type}} key)
{
if(_indexMap.TryGetValue(key,out var _))
{
return Get(key);
}
return null;
}
{{~else if x.is_list_table ~}}
private bool _readAllList = false;
private List<{{cs_define_type value_type}}> _dataList;
public List<{{cs_define_type value_type}}> DataList
{
get
{
if(!_readAllList)
{
ReadAllList();
_readAllList = true;
}
return _dataList;
}
}
private System.Func<ByteBuf> _dataLoader;
{{~if x.is_union_index~}}
private bool _readAll;
private {{cs_table_union_map_type_name x}} _dataMapUnion;
public {{cs_table_union_map_type_name x}} DataMapUnion
{
get
{
if(!_readAll)
{
ReadAll();
_readAll = true;
}
return _dataMapUnion;
}
}
private void ReadAll()
{
foreach(var index in Indexes)
{
var ({{cs_table_get_param_name_list x}}) = index;
var v = Get({{cs_table_get_param_name_list x}});
_dataMapUnion[({{cs_table_get_param_name_list x}})] = v;
}
}
private void ReadAllList()
{
_dataList.Clear();
foreach(var index in Indexes)
{
var ({{cs_table_get_param_name_list x}}) = index;
var v = Get({{cs_table_get_param_name_list x}});
_dataList.Add(v);
}
}
private Dictionary<({{cs_table_get_param_def_list x}}),int> _indexMap;
public List<({{cs_table_get_param_def_list x}})> Indexes;
{{~else if !x.index_list.empty?~}}
{{~for idx in x.index_list~}}
private bool _readAll{{idx.index_field.convention_name}} = false;
private Dictionary<{{cs_define_type idx.type}}, {{cs_define_type value_type}}> _dataMap_{{idx.index_field.name}};
public Dictionary<{{cs_define_type idx.type}}, {{cs_define_type value_type}}> DataMap_{{idx.index_field.name}}
{
get
{
if(!_readAll{{idx.index_field.convention_name}})
{
ReadAll{{idx.index_field.convention_name}}();
_readAll{{idx.index_field.convention_name}} = true;
}
return _dataMap_{{idx.index_field.name}};
}
}
{{~if for.first ~}}
private void ReadAllList()
{
_dataList.Clear();
foreach(var index in Indexes_{{idx.index_field.name}})
{
var v = GetBy{{idx.index_field.convention_name}}(index);
_dataList.Add(v);
}
}
{{~end~}}
private void ReadAll{{idx.index_field.convention_name}}()
{
foreach(var index in Indexes_{{idx.index_field.name}})
{
var v = GetBy{{idx.index_field.convention_name}}(index);
_dataMap_{{idx.index_field.name}}[index] = v;
}
}
private Dictionary<{{cs_define_type idx.type}},int> _indexMap_{{idx.index_field.name}};
public List<{{cs_define_type idx.type}}> Indexes_{{idx.index_field.name}};
{{~end~}}
{{~else~}}
private bool _readAll = false;
private Dictionary<int,int> _indexMap;
public List<int> Indexes;
private Dictionary<int, {{cs_define_type value_type}}> _dataMap;
private Dictionary<int, {{cs_define_type value_type}}> DataMap
{
get
{
if(!_readAll)
{
ReadAllList();
}
return _dataMap;
}
}
private void ReadAllList()
{
_dataList.Clear();
foreach(var index in Indexes)
{
var v = Get(index);
_dataList.Add(v);
}
}
{{~end~}}
public {{name}}(ByteBuf _buf, string _tbName, System.Func<string, ByteBuf> _loader)
{
Instance = this;
_dataList = new List<{{cs_define_type value_type}}>();
_dataLoader = new System.Func<ByteBuf>(()=> _loader(_tbName));
{{~if x.is_union_index~}}
_dataMapUnion = new {{cs_table_union_map_type_name x}}();
_indexMap = new Dictionary<({{cs_table_get_param_def_list x}}),int>();
{{key_value ='('}}
for (int i = _buf.ReadSize(); i > 0; i--)
{
{{~for idx in x.index_list~}}
{{field_name = 'key'+for.index}}
{{cs_define_type idx.type}} {{field_name}};
{{cs_deserialize '_buf' field_name idx.type}}
{{~if for.last~}}
{{key_value=key_value+field_name+')'}}
{{~else~}}
{{key_value=key_value+field_name+', '}}
{{~end~}}
{{~end~}}
_indexMap.Add({{key_value}}, _buf.ReadInt());
}
Indexes = _indexMap.Keys.ToList();
{{~else if !x.index_list.empty?~}}
{{~for idx in x.index_list~}}
_dataMap_{{idx.index_field.name}} = new Dictionary<{{cs_define_type idx.type}}, {{cs_define_type value_type}}>();
_indexMap_{{idx.index_field.name}} = new Dictionary<{{cs_define_type idx.type}},int>();
{{~end~}}
int size = _buf.ReadSize();
for(int i = 0; i < size; i++)
{
{{~for idx in x.index_list~}}
{{cs_define_type idx.type}} key_{{idx.index_field.name}};
{{cs_deserialize '_buf' 'key_'+idx.index_field.name idx.type}}
{{~end~}}
int index = _buf.ReadInt();
{{~for idx in x.index_list~}}
_indexMap_{{idx.index_field.name}}.Add(key_{{idx.index_field.name}},index);
{{~end~}}
}
{{~for idx in x.index_list~}}
Indexes_{{idx.index_field.name}} = _indexMap_{{idx.index_field.name}}.Keys.ToList();
{{~end~}}
{{~else~}}
_indexMap = new Dictionary<int,int>();
_dataMap = new Dictionary<int, {{cs_define_type value_type}}>();
int size = _buf.ReadSize();
for(int i = 0; i < size; i++)
{
_indexMap.Add(i,_buf.ReadInt());
}
Indexes = _indexMap.Keys.ToList();
{{~end~}}
}
{{~if x.is_union_index~}}
public {{cs_define_type value_type}} Get({{cs_table_get_param_def_list x}})
{
{{cs_define_type value_type}} __v;
if(_dataMapUnion.TryGetValue(({{cs_table_get_param_name_list x}}), out __v))
{
return __v;
}
ResetByteBuf(_indexMap[({{cs_table_get_param_name_list x}})]);
{{cs_deserialize '_buf' '__v' value_type}}
_dataList.Add(__v);
_dataMapUnion.Add(({{cs_table_get_param_name_list x}}), __v);
__v.Resolve(tables);
if(_indexMap.Count == _dataMapUnion.Count)
{
_buf = null;
}
return __v;
}
{{~else if !x.index_list.empty? ~}}
{{~for idx in x.index_list~}}
public {{cs_define_type value_type}} GetBy{{idx.index_field.convention_name}}({{cs_define_type idx.type}} key)
{
if(_dataMap_{{idx.index_field.name}}.TryGetValue(key,out var value))
{
return value;
}
int index = _indexMap_{{idx.index_field.name}}[key];
ResetByteBuf(index);
{{cs_define_type value_type}} _v;
{{cs_deserialize '_buf' '_v' value_type}}
_dataMap_{{idx.index_field.name}}[key] = _v;
_v.Resolve(tables);
return _v;
}
{{~end~}}
{{~else if x.index_list.empty? ~}}
public {{cs_define_type value_type}} this[int index] => Get(index);
public {{cs_define_type value_type}} Get(int index)
{
{{cs_define_type value_type}} _v;
if(_dataMap.TryGetValue(index, out _v))
{
return _v;
}
ResetByteBuf(_indexMap[index]);
{{cs_deserialize '_buf' '_v' value_type}}
_dataMap[index] = _v;
_v.Resolve(tables);
if(_indexMap.Count == _dataMap.Count)
{
_buf = null;
}
return _v;
}
{{~end~}}
{{~else~}}
private {{cs_define_type value_type}} _data;
public {{name}} (ByteBuf _buf, string _tbName, System.Func<string, ByteBuf> _loader)
{
Instance = this;
ByteBuf _dataBuf = _loader(_tbName);
int n = _buf.ReadSize();
int m = _dataBuf.ReadSize();
if (n != 1 || m != 1) throw new SerializationException("table mode=one, but size != 1");
{{cs_deserialize '_dataBuf' '_data' value_type}}
}
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
{{~if field.comment != '' ~}}
/// <summary>
/// {{field.escape_comment}}
/// </summary>
{{~end~}}
public {{cs_define_type field.ctype}} {{field.convention_name}} => _data.{{field.convention_name}};
{{~if field.gen_ref~}}
public {{cs_define_type field.ref_type}} {{field.convention_name}}_Ref => _data.{{field.convention_name}}_Ref;
{{~end~}}
{{~end~}}
{{~end~}}
{{~if x.is_map_table||x.is_list_table ~}}
private void ResetByteBuf(int readerInex = 0)
{
if( _buf == null)
{
if (_buf == null)
{
_buf = _dataLoader();
}
}
_buf.ReaderIndex = readerInex;
}
{{~end~}}
{{~if x.mode != 'ONE'~}}
private ByteBuf _buf = null;
private Dictionary<string, object> tables;
{{~end~}}
public void CacheTables(Dictionary<string, object> _tables)
{
{{~if x.mode == 'ONE'~}}
_data.Resolve(_tables);
{{~else~}}
tables = _tables;
{{~end~}}
}
partial void PostInit();
}
}

View File

@@ -0,0 +1,40 @@
using Bright.Serialization;
{{
name = x.name
namespace = x.namespace
tables = x.tables
}}
namespace {{namespace}}
{
public partial class {{name}}
{
{{~for table in tables ~}}
{{~if table.comment != '' ~}}
/// <summary>
/// {{table.escape_comment}}
/// </summary>
{{~end~}}
public {{table.full_name}} {{table.name}} {get; }
{{~end~}}
public {{name}}(System.Func<string, ByteBuf> idxLoader,System.Func<string, ByteBuf> dataLoader)
{
var tables = new System.Collections.Generic.Dictionary<string, object>();
{{~for table in tables ~}}
{{table.name}} = new {{table.full_name}}(idxLoader("{{table.output_data_file}}"),"{{table.output_data_file}}",dataLoader);
tables.Add("{{table.full_name}}", {{table.name}});
{{~end~}}
PostInit();
{{~for table in tables ~}}
{{table.name}}.CacheTables(tables);
{{~end~}}
}
partial void PostInit();
}
}

View File

@@ -10,7 +10,7 @@ using UnityEngine;
/// <summary> /// <summary>
/// 配置加载器 /// 配置加载器
/// </summary> /// </summary>
public class ConfigLoader:Singleton<ConfigLoader> public class ConfigLoader : Singleton<ConfigLoader>
{ {
private bool _init = false; private bool _init = false;
@@ -62,7 +62,7 @@ public class ConfigLoader:Singleton<ConfigLoader>
} }
else else
{ {
var textAssets = await GameModule.Resource.LoadAssetAsync<TextAsset>(location,CancellationToken.None); var textAssets = await GameModule.Resource.LoadAssetAsync<TextAsset>(location, CancellationToken.None);
ret = textAssets.bytes; ret = textAssets.bytes;
RegisterTextAssets(file, textAssets); RegisterTextAssets(file, textAssets);
} }
@@ -96,6 +96,8 @@ public class ConfigLoader:Singleton<ConfigLoader>
public class ConfigSystem : BaseLogicSys<ConfigSystem> public class ConfigSystem : BaseLogicSys<ConfigSystem>
{ {
public Tables Tables => ConfigLoader.Instance.Tables;
public override bool OnInit() public override bool OnInit()
{ {
Log.Warning("ConfigSystem OnInit"); Log.Warning("ConfigSystem OnInit");

View File

@@ -6,15 +6,15 @@ set CONF_ROOT=%WORKSPACE%\Luban\Config
set DATA_OUTPUT=%ROOT_PATH%..\GenerateDatas set DATA_OUTPUT=%ROOT_PATH%..\GenerateDatas
set CUSTOM_TEMP=%WORKSPACE%\Luban\CustomTemplate_Client set CUSTOM_TEMP=%WORKSPACE%\Luban\CustomTemplate_Client
xcopy %CUSTOM_TEMP%\ConfigLoader.cs %WORKSPACE%\Assets\GameScripts\HotFix\GameProto\\ConfigLoader.cs /s /e /i /y xcopy %CUSTOM_TEMP%\ConfigLoader.cs %WORKSPACE%\Assets\GameScripts\HotFix\GameProto\ConfigLoader.cs /s /e /i /y
%GEN_CLIENT% -j cfg --^ %GEN_CLIENT% -j cfg --^
-d %CONF_ROOT%\Defines\__root__.xml ^ -d %CONF_ROOT%\Defines\__root__.xml ^
--input_data_dir %CONF_ROOT%\Datas ^ --input_data_dir %CONF_ROOT%\Datas ^
--output_code_dir %WORKSPACE%/Assets/GameScripts/HotFix/GameProto/GameConfig ^ --output_code_dir %WORKSPACE%/Assets/GameScripts/HotFix/GameProto/GameConfig ^
--output_data_dir ..\GenerateDatas\bytes ^ --output_data_dir %WORKSPACE%/Assets/AssetRaw/Configs/bytes/ ^
--gen_types code_cs_unity_bin,data_bin ^ --gen_types code_cs_unity_bin,data_bin ^
-s all -s client
echo ======== 生成配置文件结束 ======== echo ======== 生成配置文件结束 ========

View File

@@ -0,0 +1,39 @@
cd /d %~dp0
set WORKSPACE=..
set GEN_CLIENT=%WORKSPACE%\Luban\Luban.ClientServer\Luban.ClientServer.exe
set CONF_ROOT=%WORKSPACE%\Luban\Config
set DATA_OUTPUT=%ROOT_PATH%..\GenerateDatas
set CUSTOM_TEMP=%WORKSPACE%\Luban\CustomTemplate_Client_LazyLoad
xcopy %CUSTOM_TEMP%\ConfigLoader.cs %WORKSPACE%\Assets\GameScripts\HotFix\GameProto\ConfigLoader.cs /s /e /i /y
%GEN_CLIENT% -j cfg --^
-d %CONF_ROOT%\Defines\__root__.xml ^
--input_data_dir %CONF_ROOT%\Datas ^
--output_data_dir %WORKSPACE%/Assets/AssetRaw/Configs/bytes/ ^
--gen_types data_bin ^
-s client
%GEN_CLIENT% --template_search_path CustomTemplate_Client_LazyLoad -j cfg --^
-d %CONF_ROOT%\Defines\__root__.xml ^
--input_data_dir %CONF_ROOT%\Datas ^
--output_code_dir %WORKSPACE%/Assets/GameScripts/HotFix/GameProto/GameConfig ^
--output_data_dir ..\GenerateDatas\bidx ^
--gen_types code_cs_unity_bin,data_bidx ^
-s client
echo ======== 生成配置文件结束 ========
set WORKSPACE=..
set "prefix=Idx_"
for %%a in (%DATA_OUTPUT%\bidx\*) do (
ren "%%a" "Idx_%%~nxa"
)
echo ======== 所有文件已添加前缀 ========
xcopy %DATA_OUTPUT%\bidx\ %WORKSPACE%\Assets\AssetRaw\Configs\bidx\ /s /e /i /y
pause

View File

@@ -6,7 +6,7 @@ set CONF_ROOT=%WORKSPACE%\Luban\Config
set DATA_OUTPUT=%ROOT_PATH%..\GenerateDatas set DATA_OUTPUT=%ROOT_PATH%..\GenerateDatas
set CUSTOM_TEMP=%WORKSPACE%\Luban\CustomTemplate_Client_UniTask set CUSTOM_TEMP=%WORKSPACE%\Luban\CustomTemplate_Client_UniTask
xcopy %CUSTOM_TEMP%\ConfigLoader.cs %WORKSPACE%\Assets\GameScripts\HotFix\GameProto\\ConfigLoader.cs /s /e /i /y xcopy %CUSTOM_TEMP%\ConfigLoader.cs %WORKSPACE%\Assets\GameScripts\HotFix\GameProto\ConfigLoader.cs /s /e /i /y
%GEN_CLIENT% --template_search_path CustomTemplate_Client_UniTask -j cfg --^ %GEN_CLIENT% --template_search_path CustomTemplate_Client_UniTask -j cfg --^
-d %CONF_ROOT%\Defines\__root__.xml ^ -d %CONF_ROOT%\Defines\__root__.xml ^