Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 40f6981

Browse files
committed
Revert colorblock changes
1 parent 0555a64 commit 40f6981

File tree

5 files changed

+9
-32
lines changed

5 files changed

+9
-32
lines changed

src/Core/Runtime/Il2Cpp/Il2CppProvider.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,6 @@ public static int GetRootCount(int handle)
121121
.Invoke(handle);
122122
}
123123

124-
// ColorBlock set
125-
126-
public override void SetColorBlockColors(ref ColorBlock colorBlock, Color? normal, Color? highlighted, Color? pressed)
127-
{
128-
if (normal != null)
129-
{
130-
colorBlock.m_NormalColor = (Color)normal;
131-
colorBlock.m_SelectedColor = (Color)normal;
132-
}
133-
134-
if (highlighted != null)
135-
colorBlock.m_HighlightedColor = (Color)highlighted;
136-
137-
if (pressed != null)
138-
colorBlock.m_PressedColor = (Color)pressed;
139-
}
140-
141124
// Custom check for il2cpp input pointer event
142125

143126
public override void CheckInputPointerEvent()

src/Core/Runtime/Il2Cpp/Il2CppReflection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public static Type GetMonoType(CppType cppType)
108108

109109
Type ret = Type.GetType(name);
110110

111+
// Thanks to Slaynash for this deobfuscation snippet!
111112
if (ret == null)
112113
{
113114
string baseName = cppType.FullName;

src/Core/Runtime/Mono/MonoProvider.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,6 @@ public override int GetRootCount(Scene scene)
6060
return scene.rootCount;
6161
}
6262

63-
public override void SetColorBlockColors(ref ColorBlock block, Color? normal, Color? highlighted, Color? pressed)
64-
{
65-
if (normal != null)
66-
block.normalColor = (Color)normal;
67-
68-
if (highlighted != null)
69-
block.highlightedColor = (Color)highlighted;
70-
71-
if (pressed != null)
72-
block.pressedColor = (Color)pressed;
73-
}
74-
7563
public override void CheckInputPointerEvent()
7664
{
7765
// Not necessary afaik

src/Core/Runtime/RuntimeProvider.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public static void Init() =>
5252

5353
public abstract int GetRootCount(Scene scene);
5454

55-
public abstract void SetColorBlockColors(ref ColorBlock block, Color? normal, Color? highlight, Color? pressed);
56-
5755
public abstract void CheckInputPointerEvent();
5856
}
5957
}

src/UI/UIFactory.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@ internal static void SetDefaultSelectableColors(Selectable selectable)
6464
public static void SetColorBlockValues(ref this ColorBlock colorBlock, Color? normal = null, Color? highlighted = null,
6565
Color? pressed = null)
6666
{
67-
RuntimeProvider.Instance.SetColorBlockColors(ref colorBlock, normal, highlighted, pressed);
67+
if (normal != null)
68+
colorBlock.normalColor = (Color)normal;
69+
70+
if (highlighted != null)
71+
colorBlock.highlightedColor = (Color)highlighted;
72+
73+
if (pressed != null)
74+
colorBlock.pressedColor = (Color)pressed;
6875
}
6976

7077
/// <summary>

0 commit comments

Comments
 (0)