From 40f698122d94f20f4eabfd6e1e71b8705d214580 Mon Sep 17 00:00:00 2001 From: Sinai Date: Tue, 30 Mar 2021 19:55:18 +1100 Subject: [PATCH] Revert colorblock changes --- src/Core/Runtime/Il2Cpp/Il2CppProvider.cs | 17 ----------------- src/Core/Runtime/Il2Cpp/Il2CppReflection.cs | 1 + src/Core/Runtime/Mono/MonoProvider.cs | 12 ------------ src/Core/Runtime/RuntimeProvider.cs | 2 -- src/UI/UIFactory.cs | 9 ++++++++- 5 files changed, 9 insertions(+), 32 deletions(-) diff --git a/src/Core/Runtime/Il2Cpp/Il2CppProvider.cs b/src/Core/Runtime/Il2Cpp/Il2CppProvider.cs index 0b46760..2e81243 100644 --- a/src/Core/Runtime/Il2Cpp/Il2CppProvider.cs +++ b/src/Core/Runtime/Il2Cpp/Il2CppProvider.cs @@ -121,23 +121,6 @@ namespace UnityExplorer.Core.Runtime.Il2Cpp .Invoke(handle); } - // ColorBlock set - - public override void SetColorBlockColors(ref ColorBlock colorBlock, Color? normal, Color? highlighted, Color? pressed) - { - if (normal != null) - { - colorBlock.m_NormalColor = (Color)normal; - colorBlock.m_SelectedColor = (Color)normal; - } - - if (highlighted != null) - colorBlock.m_HighlightedColor = (Color)highlighted; - - if (pressed != null) - colorBlock.m_PressedColor = (Color)pressed; - } - // Custom check for il2cpp input pointer event public override void CheckInputPointerEvent() diff --git a/src/Core/Runtime/Il2Cpp/Il2CppReflection.cs b/src/Core/Runtime/Il2Cpp/Il2CppReflection.cs index 1083480..dd7143f 100644 --- a/src/Core/Runtime/Il2Cpp/Il2CppReflection.cs +++ b/src/Core/Runtime/Il2Cpp/Il2CppReflection.cs @@ -108,6 +108,7 @@ namespace UnityExplorer.Core.Runtime.Il2Cpp Type ret = Type.GetType(name); + // Thanks to Slaynash for this deobfuscation snippet! if (ret == null) { string baseName = cppType.FullName; diff --git a/src/Core/Runtime/Mono/MonoProvider.cs b/src/Core/Runtime/Mono/MonoProvider.cs index d76567f..d1b4745 100644 --- a/src/Core/Runtime/Mono/MonoProvider.cs +++ b/src/Core/Runtime/Mono/MonoProvider.cs @@ -60,18 +60,6 @@ namespace UnityExplorer.Core.Runtime.Mono return scene.rootCount; } - public override void SetColorBlockColors(ref ColorBlock block, Color? normal, Color? highlighted, Color? pressed) - { - if (normal != null) - block.normalColor = (Color)normal; - - if (highlighted != null) - block.highlightedColor = (Color)highlighted; - - if (pressed != null) - block.pressedColor = (Color)pressed; - } - public override void CheckInputPointerEvent() { // Not necessary afaik diff --git a/src/Core/Runtime/RuntimeProvider.cs b/src/Core/Runtime/RuntimeProvider.cs index 98af1c0..64f4abe 100644 --- a/src/Core/Runtime/RuntimeProvider.cs +++ b/src/Core/Runtime/RuntimeProvider.cs @@ -52,8 +52,6 @@ namespace UnityExplorer.Core.Runtime public abstract int GetRootCount(Scene scene); - public abstract void SetColorBlockColors(ref ColorBlock block, Color? normal, Color? highlight, Color? pressed); - public abstract void CheckInputPointerEvent(); } } diff --git a/src/UI/UIFactory.cs b/src/UI/UIFactory.cs index fa97066..77fe8e3 100644 --- a/src/UI/UIFactory.cs +++ b/src/UI/UIFactory.cs @@ -64,7 +64,14 @@ namespace UnityExplorer.UI public static void SetColorBlockValues(ref this ColorBlock colorBlock, Color? normal = null, Color? highlighted = null, Color? pressed = null) { - RuntimeProvider.Instance.SetColorBlockColors(ref colorBlock, normal, highlighted, pressed); + if (normal != null) + colorBlock.normalColor = (Color)normal; + + if (highlighted != null) + colorBlock.highlightedColor = (Color)highlighted; + + if (pressed != null) + colorBlock.pressedColor = (Color)pressed; } ///