mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
Merge pull request #147 from tpxxn/main
refactor AtlasMakerEditor & luban gen code code.lineEnding=crlf & luban Vector ExternalTypeUtil
This commit is contained in:
29
Configs/GameConfig/CustomTemplate/ExternalTypeUtil.cs
Normal file
29
Configs/GameConfig/CustomTemplate/ExternalTypeUtil.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
@@ -2,16 +2,45 @@
|
||||
<bean name="vector2" valueType="1" sep=",">
|
||||
<var name="x" type="float" />
|
||||
<var name="y" type="float" />
|
||||
<mapper target="client" codeTarget="cs-bin,cs-simple-json,cs-newtonsoft-json">
|
||||
<option name="type" value="UnityEngine.Vector2" />
|
||||
<option name="constructor" value="ExternalTypeUtil.NewVector2" />
|
||||
</mapper>
|
||||
</bean>
|
||||
<bean name="vector3" valueType="1" sep=",">
|
||||
<var name="x" type="float" />
|
||||
<var name="y" type="float" />
|
||||
<var name="z" type="float" />
|
||||
<mapper target="client" codeTarget="cs-bin,cs-simple-json,cs-newtonsoft-json">
|
||||
<option name="type" value="UnityEngine.Vector3" />
|
||||
<option name="constructor" value="ExternalTypeUtil.NewVector3" />
|
||||
</mapper>
|
||||
</bean>
|
||||
<bean name="vector4" valueType="1" sep=",">
|
||||
<var name="x" type="float" />
|
||||
<var name="y" type="float" />
|
||||
<var name="z" type="float" />
|
||||
<var name="w" type="float" />
|
||||
<mapper target="client" codeTarget="cs-bin,cs-simple-json,cs-newtonsoft-json">
|
||||
<option name="type" value="UnityEngine.Vector4" />
|
||||
<option name="constructor" value="ExternalTypeUtil.NewVector4" />
|
||||
</mapper>
|
||||
</bean>
|
||||
<bean name="vector2int" valueType="1" sep=",">
|
||||
<var name="x" type="int" />
|
||||
<var name="y" type="int" />
|
||||
<mapper target="client" codeTarget="cs-bin,cs-simple-json,cs-newtonsoft-json">
|
||||
<option name="type" value="UnityEngine.Vector2Int" />
|
||||
<option name="constructor" value="ExternalTypeUtil.NewVector2Int" />
|
||||
</mapper>
|
||||
</bean>
|
||||
<bean name="vector3int" valueType="1" sep=",">
|
||||
<var name="x" type="int" />
|
||||
<var name="y" type="int" />
|
||||
<var name="z" type="int" />
|
||||
<mapper target="client" codeTarget="cs-bin,cs-simple-json,cs-newtonsoft-json">
|
||||
<option name="type" value="UnityEngine.Vector3" />
|
||||
<option name="constructor" value="ExternalTypeUtil.NewVector3" />
|
||||
</mapper>
|
||||
</bean>
|
||||
</module>
|
@@ -8,12 +8,14 @@ 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 ^
|
||||
-c cs-bin ^
|
||||
-d bin^
|
||||
--conf %CONF_ROOT%\luban.conf ^
|
||||
-x code.lineEnding=crlf ^
|
||||
-x outputCodeDir=%CODE_OUTPATH% ^
|
||||
-x outputDataDir=%DATA_OUTPATH%
|
||||
pause
|
||||
|
@@ -11,12 +11,15 @@ 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 \
|
||||
-c cs-bin \
|
||||
-d bin \
|
||||
--conf "${CONF_ROOT}/luban.conf" \
|
||||
-x code.lineEnding=crlf \
|
||||
-x outputCodeDir="${CODE_OUTPATH}" \
|
||||
-x outputDataDir="${DATA_OUTPATH}"
|
||||
|
||||
|
@@ -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 ^
|
||||
@@ -15,6 +16,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
|
||||
|
@@ -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 \
|
||||
@@ -18,6 +20,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}"
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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}"
|
||||
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user