diff --git a/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll b/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll index 81271bc..f99869d 100644 Binary files a/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll and b/UnityEditorPackage/Runtime/UnityExplorer.STANDALONE.Mono.dll differ diff --git a/UnityEditorPackage/Runtime/UniverseLib.Mono.dll b/UnityEditorPackage/Runtime/UniverseLib.Mono.dll index b0fe12b..599499c 100644 Binary files a/UnityEditorPackage/Runtime/UniverseLib.Mono.dll and b/UnityEditorPackage/Runtime/UniverseLib.Mono.dll differ diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 00f7d29..4ca65a3 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -14,7 +14,7 @@ namespace UnityExplorer public static class ExplorerCore { public const string NAME = "UnityExplorer"; - public const string VERSION = "4.7.13"; + public const string VERSION = "4.8.0"; public const string AUTHOR = "Sinai"; public const string GUID = "com.sinai.unityexplorer"; diff --git a/src/Hooks/HookInstance.cs b/src/Hooks/HookInstance.cs index 177a215..3be6cb5 100644 --- a/src/Hooks/HookInstance.cs +++ b/src/Hooks/HookInstance.cs @@ -15,7 +15,6 @@ namespace UnityExplorer.Hooks { // Static - //static readonly StringBuilder evalOutput = new(); static readonly StringBuilder evaluatorOutput; static readonly ScriptEvaluator scriptEvaluator = new(new StringWriter(evaluatorOutput = new StringBuilder())); @@ -31,21 +30,22 @@ namespace UnityExplorer.Hooks // Instance public bool Enabled; + public MethodInfo TargetMethod; public string PatchSourceCode; - private readonly string shortSignature; - private PatchProcessor patchProcessor; + readonly string signature; + PatchProcessor patchProcessor; - private MethodInfo postfix; - private MethodInfo prefix; - private MethodInfo finalizer; - private MethodInfo transpiler; + MethodInfo postfix; + MethodInfo prefix; + MethodInfo finalizer; + MethodInfo transpiler; public HookInstance(MethodInfo targetMethod) { this.TargetMethod = targetMethod; - this.shortSignature = TargetMethod.FullDescription(); + this.signature = TargetMethod.FullDescription(); GenerateDefaultPatchSourceCode(targetMethod); @@ -144,7 +144,7 @@ namespace UnityExplorer.Hooks { StringBuilder codeBuilder = new(); - codeBuilder.Append("static void Postfix("); // System.Reflection.MethodBase __originalMethod + codeBuilder.Append("static void Postfix("); bool isStatic = targetMethod.IsStatic; @@ -175,7 +175,7 @@ namespace UnityExplorer.Hooks codeBuilder.AppendLine(" try {"); codeBuilder.AppendLine(" StringBuilder sb = new StringBuilder();"); codeBuilder.AppendLine($" sb.AppendLine(\"--------------------\");"); - codeBuilder.AppendLine($" sb.AppendLine(\"{shortSignature}\");"); + codeBuilder.AppendLine($" sb.AppendLine(\"{signature}\");"); if (!targetMethod.IsStatic) codeBuilder.AppendLine($" sb.Append(\"- __instance: \").AppendLine(__instance.ToString());"); @@ -207,15 +207,11 @@ namespace UnityExplorer.Hooks codeBuilder.AppendLine($" UnityExplorer.ExplorerCore.Log(sb.ToString());"); codeBuilder.AppendLine(" }"); codeBuilder.AppendLine(" catch (System.Exception ex) {"); - codeBuilder.AppendLine($" UnityExplorer.ExplorerCore.LogWarning($\"Exception in patch of {shortSignature}:\\n{{ex}}\");"); + codeBuilder.AppendLine($" UnityExplorer.ExplorerCore.LogWarning($\"Exception in patch of {signature}:\\n{{ex}}\");"); codeBuilder.AppendLine(" }"); - // End patch body - codeBuilder.AppendLine("}"); - //ExplorerCore.Log(codeBuilder.ToString()); - return PatchSourceCode = codeBuilder.ToString(); } diff --git a/src/UnityExplorer.csproj b/src/UnityExplorer.csproj index 9349aec..e84904e 100644 --- a/src/UnityExplorer.csproj +++ b/src/UnityExplorer.csproj @@ -79,11 +79,11 @@ - + - +