[change] Il2CppDefGenerator对于团结引擎额外生成一个UNITY_ENGINE_TUANJIE宏定义

main
walon 2024-01-02 13:06:29 +08:00
parent 51da1d4c43
commit db87b92f78
1 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,12 @@ namespace HybridCLR.Editor.Il2CppDef
GeneratePlaceHolderAssemblies();
}
private static bool IsTuanJie()
{
return Regex.IsMatch(Application.unityVersion, @".*t\d+$");
}
private void GenerateIl2CppConfig()
{
var frr = new FileRegionReplace(File.ReadAllText(_options.OutputFile));
@ -60,6 +66,11 @@ namespace HybridCLR.Editor.Il2CppDef
}
}
if (IsTuanJie())
{
lines.Add($"#define UNITY_ENGINE_TUANJIE 1");
}
frr.Replace("UNITY_VERSION", string.Join("\n", lines));
frr.Commit(_options.OutputFile);