From 2ff3e276d22e73634aa75265ff2c3211444c71a5 Mon Sep 17 00:00:00 2001 From: walon Date: Tue, 28 Mar 2023 13:20:34 +0800 Subject: [PATCH] =?UTF-8?q?[revert]=20=E5=9B=9E=E6=BB=9A=E7=89=88=E6=9C=AC?= =?UTF-8?q?"6909c32a0c8fcf11d4b573af890a0232c1525afe=20[new]=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=202021=20WebGL=E8=B5=84=E6=BA=90=E4=B8=8A=E6=8C=82?= =?UTF-8?q?=E8=BD=BD=E8=84=9A=E6=9C=AC"=20=E5=BC=95=E5=85=A5=E7=9A=84MonoH?= =?UTF-8?q?ook=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/3rds/UnityHook/LDasm.cs | 12 +++--------- Editor/3rds/UnityHook/MethodHook.cs | 10 ++++++++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Editor/3rds/UnityHook/LDasm.cs b/Editor/3rds/UnityHook/LDasm.cs index d766e66..d87ab91 100644 --- a/Editor/3rds/UnityHook/LDasm.cs +++ b/Editor/3rds/UnityHook/LDasm.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.InteropServices; namespace DotNetDetour { @@ -641,15 +642,8 @@ namespace DotNetDetour if(s_isArm.HasValue) return s_isArm.Value; - string processorType = UnityEngine.SystemInfo.processorType; - - /* - * 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"); + var arch = RuntimeInformation.ProcessArchitecture; + s_isArm = arch == Architecture.Arm || arch == Architecture.Arm64; return s_isArm.Value; } diff --git a/Editor/3rds/UnityHook/MethodHook.cs b/Editor/3rds/UnityHook/MethodHook.cs index f128c85..2c7c862 100644 --- a/Editor/3rds/UnityHook/MethodHook.cs +++ b/Editor/3rds/UnityHook/MethodHook.cs @@ -363,8 +363,14 @@ namespace MonoHook { if (s_fi_GUISkin_current.GetValue(null) != null) { - DoInstall(); - EditorApplication.update -= OnEditorUpdate; + try + { + DoInstall(); + } + finally + { + EditorApplication.update -= OnEditorUpdate; + } } } #endif