From 122b5b27ad81a718a75ca23a2714d481b51e50ba Mon Sep 17 00:00:00 2001 From: tpxxn <351765204@qq.com> Date: Tue, 6 May 2025 13:58:02 +0800 Subject: [PATCH 1/3] refactor AtlasMakerEditor --- .../TEngine/Editor/AtlasMakerEditor/EditorSpriteSaveInfo.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UnityProject/Assets/TEngine/Editor/AtlasMakerEditor/EditorSpriteSaveInfo.cs b/UnityProject/Assets/TEngine/Editor/AtlasMakerEditor/EditorSpriteSaveInfo.cs index b6265625..6b910275 100644 --- a/UnityProject/Assets/TEngine/Editor/AtlasMakerEditor/EditorSpriteSaveInfo.cs +++ b/UnityProject/Assets/TEngine/Editor/AtlasMakerEditor/EditorSpriteSaveInfo.cs @@ -88,9 +88,8 @@ public static void MarkParentAtlasesDirty(string assetPath) { - var currentPath = Path.GetDirectoryName(assetPath); + var currentPath = Path.GetDirectoryName(assetPath).Replace("\\", "/"); var rootPath = Config.sourceAtlasRoot.Replace("\\", "/").TrimEnd('/'); - currentPath = currentPath.Replace("\\", "/"); while (currentPath != null && currentPath.StartsWith(rootPath)) { var parentAtlasName = GetAtlasNameForDirectory(currentPath); From c1d9fe5ca75cc37bc6b943fd15fe22cb360fcc80 Mon Sep 17 00:00:00 2001 From: tpxxn <351765204@qq.com> Date: Tue, 6 May 2025 14:02:24 +0800 Subject: [PATCH 2/3] luban gen code code.lineEnding=crlf --- Configs/GameConfig/gen_code_bin_to_project.bat | 1 + Configs/GameConfig/gen_code_bin_to_project.sh | 1 + Configs/GameConfig/gen_code_bin_to_project_lazyload.bat | 1 + Configs/GameConfig/gen_code_bin_to_project_lazyload.sh | 1 + Configs/GameConfig/gen_code_bin_to_server.bat | 1 + Configs/GameConfig/gen_code_bin_to_server.sh | 1 + 6 files changed, 6 insertions(+) diff --git a/Configs/GameConfig/gen_code_bin_to_project.bat b/Configs/GameConfig/gen_code_bin_to_project.bat index aaccdbdd..cfdf94a7 100644 --- a/Configs/GameConfig/gen_code_bin_to_project.bat +++ b/Configs/GameConfig/gen_code_bin_to_project.bat @@ -14,6 +14,7 @@ dotnet %LUBAN_DLL% ^ -c cs-bin ^ -d bin^ --conf %CONF_ROOT%\luban.conf ^ + -x code.lineEnding=crlf ^ -x outputCodeDir=%CODE_OUTPATH% ^ -x outputDataDir=%DATA_OUTPATH% pause diff --git a/Configs/GameConfig/gen_code_bin_to_project.sh b/Configs/GameConfig/gen_code_bin_to_project.sh index 59269d99..7264b65f 100644 --- a/Configs/GameConfig/gen_code_bin_to_project.sh +++ b/Configs/GameConfig/gen_code_bin_to_project.sh @@ -17,6 +17,7 @@ dotnet "${LUBAN_DLL}" \ -c cs-bin \ -d bin \ --conf "${CONF_ROOT}/luban.conf" \ + -x code.lineEnding=crlf \ -x outputCodeDir="${CODE_OUTPATH}" \ -x outputDataDir="${DATA_OUTPATH}" diff --git a/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat b/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat index c97c8377..c3a47c4f 100644 --- a/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat +++ b/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat @@ -15,6 +15,7 @@ dotnet %LUBAN_DLL% ^ -d bin^ --conf %CONF_ROOT%\luban.conf ^ --customTemplateDir %CONF_ROOT%\CustomTemplate\CustomTemplate_Client_LazyLoad ^ + -x code.lineEnding=crlf ^ -x outputCodeDir=%CODE_OUTPATH% ^ -x outputDataDir=%DATA_OUTPATH% pause diff --git a/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh b/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh index 7324d765..9f788352 100644 --- a/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh +++ b/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh @@ -18,6 +18,7 @@ dotnet "${LUBAN_DLL}" \ -d bin \ --conf "${CONF_ROOT}/luban.conf" \ --customTemplateDir "${CONF_ROOT}/CustomTemplate/CustomTemplate_Client_LazyLoad" \ + -x code.lineEnding=crlf \ -x outputCodeDir="${CODE_OUTPATH}" \ -x outputDataDir="${DATA_OUTPATH}" diff --git a/Configs/GameConfig/gen_code_bin_to_server.bat b/Configs/GameConfig/gen_code_bin_to_server.bat index 697220e7..adaf71a6 100644 --- a/Configs/GameConfig/gen_code_bin_to_server.bat +++ b/Configs/GameConfig/gen_code_bin_to_server.bat @@ -12,6 +12,7 @@ dotnet %LUBAN_DLL% ^ -c cs-bin ^ -d bin^ --conf %CONF_ROOT%\luban.conf ^ + -x code.lineEnding=crlf ^ -x outputCodeDir=%CODE_OUTPATH% ^ -x outputDataDir=%DATA_OUTPATH% pause diff --git a/Configs/GameConfig/gen_code_bin_to_server.sh b/Configs/GameConfig/gen_code_bin_to_server.sh index 4b257d38..12de6cbc 100644 --- a/Configs/GameConfig/gen_code_bin_to_server.sh +++ b/Configs/GameConfig/gen_code_bin_to_server.sh @@ -14,6 +14,7 @@ dotnet "${LUBAN_DLL}" \ -c cs-bin \ -d bin \ --conf "${CONF_ROOT}/luban.conf" \ + -x code.lineEnding=crlf \ -x outputCodeDir="${CODE_OUTPATH}" \ -x outputDataDir="${DATA_OUTPATH}" From 03aabf6b08eb265d17fd2ee43d15e38e31f821c8 Mon Sep 17 00:00:00 2001 From: tpxxn <351765204@qq.com> Date: Tue, 6 May 2025 14:15:01 +0800 Subject: [PATCH 3/3] luban Vector ExternalTypeUtil --- .../CustomTemplate/ExternalTypeUtil.cs | 29 ++++++++++++ Configs/GameConfig/Defines/builtin.xml | 47 +++++++++++++++---- .../GameConfig/gen_code_bin_to_project.bat | 1 + Configs/GameConfig/gen_code_bin_to_project.sh | 2 + .../gen_code_bin_to_project_lazyload.bat | 1 + .../gen_code_bin_to_project_lazyload.sh | 2 + 6 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 Configs/GameConfig/CustomTemplate/ExternalTypeUtil.cs diff --git a/Configs/GameConfig/CustomTemplate/ExternalTypeUtil.cs b/Configs/GameConfig/CustomTemplate/ExternalTypeUtil.cs new file mode 100644 index 00000000..f91d9e8a --- /dev/null +++ b/Configs/GameConfig/CustomTemplate/ExternalTypeUtil.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +public static class ExternalTypeUtil +{ + public static Vector2 NewVector2(cfg.vector2 v) + { + return new Vector2(v.X, v.Y); + } + + public static Vector3 NewVector3(cfg.vector3 v) + { + return new Vector3(v.X, v.Y, v.Z); + } + + public static Vector4 NewVector4(cfg.vector4 v) + { + return new Vector4(v.X, v.Y, v.Z, v.W); + } + + public static Vector2Int NewVector2Int(cfg.vector2int v) + { + return new Vector2Int(v.X, v.Y); + } + + public static Vector3Int NewVector3Int(cfg.vector3int v) + { + return new Vector3Int(v.X, v.Y, v.Z); + } +} \ No newline at end of file diff --git a/Configs/GameConfig/Defines/builtin.xml b/Configs/GameConfig/Defines/builtin.xml index e535ff48..87a7071f 100644 --- a/Configs/GameConfig/Defines/builtin.xml +++ b/Configs/GameConfig/Defines/builtin.xml @@ -1,17 +1,46 @@ - - + + + + - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Configs/GameConfig/gen_code_bin_to_project.bat b/Configs/GameConfig/gen_code_bin_to_project.bat index cfdf94a7..a6f8c52d 100644 --- a/Configs/GameConfig/gen_code_bin_to_project.bat +++ b/Configs/GameConfig/gen_code_bin_to_project.bat @@ -8,6 +8,7 @@ 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" +xcopy /s /e /i /y "%CONF_ROOT%\CustomTemplate\ExternalTypeUtil.cs" "%WORKSPACE%\UnityProject\Assets\GameScripts\HotFix\GameProto\ExternalTypeUtil.cs" dotnet %LUBAN_DLL% ^ -t client ^ diff --git a/Configs/GameConfig/gen_code_bin_to_project.sh b/Configs/GameConfig/gen_code_bin_to_project.sh index 7264b65f..08936598 100644 --- a/Configs/GameConfig/gen_code_bin_to_project.sh +++ b/Configs/GameConfig/gen_code_bin_to_project.sh @@ -11,6 +11,8 @@ export CODE_OUTPATH="${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GamePro cp -R "${CONF_ROOT}/CustomTemplate/ConfigSystem.cs" \ "${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GameProto/ConfigSystem.cs" +cp -R "${CONF_ROOT}/CustomTemplate/ExternalTypeUtil.cs" \ + "${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GameProto/ExternalTypeUtil.cs" dotnet "${LUBAN_DLL}" \ -t client \ diff --git a/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat b/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat index c3a47c4f..d9722abd 100644 --- a/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat +++ b/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat @@ -8,6 +8,7 @@ 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" +xcopy /s /e /i /y "%CONF_ROOT%\CustomTemplate\ExternalTypeUtil.cs" "%WORKSPACE%\UnityProject\Assets\GameScripts\HotFix\GameProto\ExternalTypeUtil.cs" dotnet %LUBAN_DLL% ^ -t client ^ diff --git a/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh b/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh index 9f788352..7d354f99 100644 --- a/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh +++ b/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh @@ -11,6 +11,8 @@ export CODE_OUTPATH="${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GamePro cp -R "${CONF_ROOT}/CustomTemplate/ConfigSystem.cs" \ "${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GameProto/ConfigSystem.cs" +cp -R "${CONF_ROOT}/CustomTemplate/ExternalTypeUtil.cs" \ + "${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GameProto/ExternalTypeUtil.cs" dotnet "${LUBAN_DLL}" \ -t client \