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] 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 \