@@ -17,13 +17,9 @@ namespace HybridCLR.Editor.Il2CppDef
|
||||
{
|
||||
public List<string> HotUpdateAssemblies { get; set; }
|
||||
|
||||
public string UnityVersionTemplateFile { get; set; }
|
||||
public string OutputFile { get; set; }
|
||||
|
||||
public string UnityVersionOutputFile { get; set; }
|
||||
|
||||
public string AssemblyManifestTemplateFile { get; set; }
|
||||
|
||||
public string AssemblyManifestOutputFile { get; set; }
|
||||
public string OutputFile2 { get; set; }
|
||||
|
||||
public string UnityVersion { get; set; }
|
||||
}
|
||||
@@ -45,7 +41,7 @@ namespace HybridCLR.Editor.Il2CppDef
|
||||
|
||||
private void GenerateIl2CppConfig()
|
||||
{
|
||||
var frr = new FileRegionReplace(File.ReadAllText(_options.UnityVersionTemplateFile));
|
||||
var frr = new FileRegionReplace(File.ReadAllText(_options.OutputFile));
|
||||
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
@@ -56,40 +52,23 @@ namespace HybridCLR.Editor.Il2CppDef
|
||||
|
||||
lines.Add($"#define HYBRIDCLR_UNITY_VERSION {majorVer}{minorVer1.ToString("D2")}{minorVer2.ToString("D2")}");
|
||||
lines.Add($"#define HYBRIDCLR_UNITY_{majorVer} 1");
|
||||
for (int ver = 2019; ver <= 2023; ver++)
|
||||
for (int ver = 2019; ver <= 2024; ver++)
|
||||
{
|
||||
if (majorVer >= ver)
|
||||
{
|
||||
lines.Add($"#define HYBRIDCLR_UNITY_{ver}_OR_NEW 1");
|
||||
}
|
||||
}
|
||||
for (int ver = 6000; ver <= 6100; ver++)
|
||||
{
|
||||
if (majorVer >= ver)
|
||||
{
|
||||
lines.Add($"#define HYBRIDCLR_UNITY_{ver}_OR_NEW 1");
|
||||
}
|
||||
}
|
||||
|
||||
#if TUANJIE_1_1_OR_NEWER
|
||||
var tuanjieMatch = Regex.Matches(Application.tuanjieVersion, @"(\d+)\.(\d+)\.(\d+)");
|
||||
int tuanjieMajorVer = int.Parse(tuanjieMatch[0].Groups[1].Value);
|
||||
int tuanjieMinorVer1 = int.Parse(tuanjieMatch[0].Groups[2].Value);
|
||||
int tuanjieMinorVer2 = int.Parse(tuanjieMatch[0].Groups[3].Value);
|
||||
lines.Add($"#define HYBRIDCLR_TUANJIE_VERSION {tuanjieMajorVer}{tuanjieMinorVer1.ToString("D2")}{tuanjieMinorVer2.ToString("D2")}");
|
||||
#elif TUANJIE_2022_3_OR_NEWER
|
||||
lines.Add($"#define HYBRIDCLR_TUANJIE_VERSION 10000");
|
||||
#endif
|
||||
|
||||
frr.Replace("UNITY_VERSION", string.Join("\n", lines));
|
||||
|
||||
frr.Commit(_options.UnityVersionOutputFile);
|
||||
Debug.Log($"[HybridCLR.Editor.Il2CppDef.Generator] output:{_options.UnityVersionOutputFile}");
|
||||
frr.Commit(_options.OutputFile);
|
||||
Debug.Log($"[HybridCLR.Editor.Il2CppDef.Generator] output:{_options.OutputFile}");
|
||||
}
|
||||
|
||||
private void GeneratePlaceHolderAssemblies()
|
||||
{
|
||||
var frr = new FileRegionReplace(File.ReadAllText(_options.AssemblyManifestTemplateFile));
|
||||
var frr = new FileRegionReplace(File.ReadAllText(_options.OutputFile2));
|
||||
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
@@ -100,8 +79,8 @@ namespace HybridCLR.Editor.Il2CppDef
|
||||
|
||||
frr.Replace("PLACE_HOLDER", string.Join("\n", lines));
|
||||
|
||||
frr.Commit(_options.AssemblyManifestOutputFile);
|
||||
Debug.Log($"[HybridCLR.Editor.Il2CppDef.Generator] output:{_options.AssemblyManifestOutputFile}");
|
||||
frr.Commit(_options.OutputFile2);
|
||||
Debug.Log($"[HybridCLR.Editor.Il2CppDef.Generator] output:{_options.OutputFile2}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user