fix: fix compile error of PatchScriptingAssembliesJsonHook.cs on WebGL or WeixinMiniGame
parent
baa70f8eb9
commit
52f07bc8b3
|
|
@ -18,9 +18,16 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
|
using MonoHook;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace HybridCLR.BuildProcessors.Hooks
|
namespace HybridCLR.BuildProcessors.Hooks
|
||||||
{
|
{
|
||||||
#if UNITY_2021_1_OR_NEWER && (UNITY_WEBGL || UNITY_WEIXINMINIGAME)
|
|
||||||
[InitializeOnLoad]
|
[InitializeOnLoad]
|
||||||
public class PatchScriptingAssembliesJsonHook
|
public class PatchScriptingAssembliesJsonHook
|
||||||
{
|
{
|
||||||
|
|
@ -36,8 +43,10 @@ namespace HybridCLR.BuildProcessors.Hooks
|
||||||
MethodInfo miReplacement = new Func<string>(BuildMainWindowTitle).Method;
|
MethodInfo miReplacement = new Func<string>(BuildMainWindowTitle).Method;
|
||||||
MethodInfo miProxy = new Func<string>(BuildMainWindowTitleProxy).Method;
|
MethodInfo miProxy = new Func<string>(BuildMainWindowTitleProxy).Method;
|
||||||
|
|
||||||
|
#if UNITY_2021_1_OR_NEWER && (UNITY_WEBGL || UNITY_WEIXINMINIGAME)
|
||||||
_hook = new MethodHook(miTarget, miReplacement, miProxy);
|
_hook = new MethodHook(miTarget, miReplacement, miProxy);
|
||||||
_hook.Install();
|
_hook.Install();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,5 +87,4 @@ namespace HybridCLR.BuildProcessors.Hooks
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue