[revert] 回滚版本"6909c32a0c8fcf11d4b573af890a0232c1525afe [new] 支持 2021 WebGL资源上挂载脚本" 引入的MonoHook的bug

main
walon 2023-03-28 13:20:34 +08:00
parent 1d5f2a953c
commit 2ff3e276d2
2 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Runtime.InteropServices;
namespace DotNetDetour namespace DotNetDetour
{ {
@ -641,15 +642,8 @@ namespace DotNetDetour
if(s_isArm.HasValue) if(s_isArm.HasValue)
return s_isArm.Value; return s_isArm.Value;
string processorType = UnityEngine.SystemInfo.processorType; var arch = RuntimeInformation.ProcessArchitecture;
s_isArm = arch == Architecture.Arm || arch == Architecture.Arm64;
/*
* appple M
* SystemInfo.processorType : Apple M1 Max, Apple M2
* SystemInfo.operatingSystem : Mac OS X xx.x.x
*
*/
s_isArm = processorType.Contains("ARM") || processorType.Contains("Apple M");
return s_isArm.Value; return s_isArm.Value;
} }

View File

@ -362,11 +362,17 @@ namespace MonoHook
private void OnEditorUpdate() private void OnEditorUpdate()
{ {
if (s_fi_GUISkin_current.GetValue(null) != null) if (s_fi_GUISkin_current.GetValue(null) != null)
{
try
{ {
DoInstall(); DoInstall();
}
finally
{
EditorApplication.update -= OnEditorUpdate; EditorApplication.update -= OnEditorUpdate;
} }
} }
}
#endif #endif
#endregion #endregion