mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
luban-next支持懒加载 感谢半仙儿提供支持
luban-next支持懒加载 感谢半仙儿提供支持
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using Luban;
|
||||
|
||||
{{namespace_with_grace_begin __namespace}}
|
||||
public partial class {{__name}}
|
||||
{
|
||||
#region The Tables
|
||||
|
||||
{{~for table in __tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{escape_comment table.comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
private {{table.full_name}} m_{{table.name}};
|
||||
public {{table.full_name}} {{format_property_name __code_style table.name}}
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_{{table.name}} == null)
|
||||
{
|
||||
m_{{table.name}} = new {{table.full_name}}(defaultLoader("{{table.output_data_file}}"));
|
||||
m_{{table.name}}.ResolveRef(this);
|
||||
}
|
||||
return m_{{table.name}};
|
||||
}
|
||||
set
|
||||
{
|
||||
m_{{table.name}} = value;
|
||||
m_{{table.name}}.ResolveRef(this);
|
||||
}
|
||||
}
|
||||
{{~end~}}
|
||||
|
||||
#endregion
|
||||
|
||||
System.Func<string, ByteBuf> defaultLoader;
|
||||
|
||||
public {{__name}}(System.Func<string, ByteBuf> loader)
|
||||
{
|
||||
SetDefaultLoader(loader);
|
||||
Init();
|
||||
}
|
||||
|
||||
public void SetDefaultLoader(System.Func<string, ByteBuf> loader)
|
||||
{
|
||||
defaultLoader = null;
|
||||
defaultLoader = loader;
|
||||
}
|
||||
|
||||
//public partial void Init();
|
||||
|
||||
public void Init(){}
|
||||
}
|
||||
|
||||
{{namespace_with_grace_end __namespace}}
|
@@ -3,6 +3,9 @@ set LUBAN_DLL=%WORKSPACE%\Tools\Luban\Luban.dll
|
||||
set CONF_ROOT=.
|
||||
set DATA_OUTPATH=%WORKSPACE%/UnityProject/Assets/AssetRaw/Configs/bytes/
|
||||
set CODE_OUTPATH=%WORKSPACE%/UnityProject/Assets/GameScripts/HotFix/GameProto/GameConfig/
|
||||
|
||||
xcopy /s /e /i /y "%CONF_ROOT%/CustomTemplate/ConfigSystem.cs" "%WORKSPACE%/UnityProject/Assets/GameScripts/HotFix/GameProto/ConfigSystem.cs"
|
||||
|
||||
dotnet %LUBAN_DLL% ^
|
||||
-t client ^
|
||||
-c cs-bin ^
|
||||
|
18
Configs/GameConfig/gen_code_bin_to_project_lazyload.bat
Normal file
18
Configs/GameConfig/gen_code_bin_to_project_lazyload.bat
Normal file
@@ -0,0 +1,18 @@
|
||||
set WORKSPACE=../..
|
||||
set LUBAN_DLL=%WORKSPACE%\Tools\Luban\Luban.dll
|
||||
set CONF_ROOT=.
|
||||
set DATA_OUTPATH=%WORKSPACE%/UnityProject/Assets/AssetRaw/Configs/bytes/
|
||||
set CODE_OUTPATH=%WORKSPACE%/UnityProject/Assets/GameScripts/HotFix/GameProto/GameConfig/
|
||||
|
||||
xcopy /s /e /i /y "%CONF_ROOT%/CustomTemplate/ConfigSystem.cs" "%WORKSPACE%/UnityProject/Assets/GameScripts/HotFix/GameProto/ConfigSystem.cs"
|
||||
|
||||
dotnet %LUBAN_DLL% ^
|
||||
-t client ^
|
||||
-c cs-bin ^
|
||||
-d bin^
|
||||
--conf %CONF_ROOT%\luban.conf ^
|
||||
--customTemplateDir %CONF_ROOT%\CustomTemplate\CustomTemplate_Client_LazyLoad ^
|
||||
-x outputCodeDir=%CODE_OUTPATH% ^
|
||||
-x outputDataDir=%DATA_OUTPATH%
|
||||
pause
|
||||
|
Reference in New Issue
Block a user