支持Unity 2019

backup
walon 2025-04-19 12:00:40 +08:00
parent b9351e5066
commit 26d46be47b
1 changed files with 3 additions and 5 deletions

View File

@ -15,7 +15,7 @@ using System.Reflection;
namespace Obfuz namespace Obfuz
{ {
#if UNITY_2021 || UNITY_2020_1_OR_NEWER #if UNITY_2019 || UNITY_2020 || UNITY_2021
internal class ObfuzProcess2021 : IPreprocessBuildWithReport, IPostprocessBuildWithReport internal class ObfuzProcess2021 : IPreprocessBuildWithReport, IPostprocessBuildWithReport
{ {
private static bool s_obfuscated = false; private static bool s_obfuscated = false;
@ -38,10 +38,8 @@ namespace Obfuz
#if UNITY_2021 #if UNITY_2021
object settings = obj.GetType().GetProperty("settings").GetValue(obj); object settings = obj.GetType().GetProperty("settings").GetValue(obj);
string path = (string)settings.GetType().GetProperty("OutputDirectory").GetValue(settings); string path = (string)settings.GetType().GetProperty("OutputDirectory").GetValue(settings);
#elif UNITY_2020
return "Library/PlayerScriptAssemblies";
#else #else
throw new Exception(); return "Library/PlayerScriptAssemblies";
#endif #endif
} }
@ -88,7 +86,7 @@ namespace Obfuz
#if UNITY_2021_1_OR_NEWER #if UNITY_2021_1_OR_NEWER
Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api/Facades"), Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api/Facades"),
Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api"), Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api"),
#elif UNITY_2020 #elif UNITY_2020 || UNITY_2019
Path.Combine(applicationContentsPath, "MonoBleedingEdge/lib/mono/4.7.1-api/Facades"), Path.Combine(applicationContentsPath, "MonoBleedingEdge/lib/mono/4.7.1-api/Facades"),
Path.Combine(applicationContentsPath, "MonoBleedingEdge/lib/mono/4.7.1-api"), Path.Combine(applicationContentsPath, "MonoBleedingEdge/lib/mono/4.7.1-api"),
#else #else