@@ -164,8 +164,10 @@ public static int GetRootCount(int handle)
164
164
internal static PropertyInfo _normalColorProp ;
165
165
internal static PropertyInfo _highlightColorProp ;
166
166
internal static PropertyInfo _pressedColorProp ;
167
+ internal static PropertyInfo _disabledColorProp ;
167
168
168
- public override void SetColorBlock ( Selectable selectable , Color ? normal = null , Color ? highlighted = null , Color ? pressed = null )
169
+ public override void SetColorBlock ( Selectable selectable , Color ? normal = null , Color ? highlighted = null , Color ? pressed = null ,
170
+ Color ? disabled = null )
169
171
{
170
172
var colors = selectable . colors ;
171
173
@@ -183,6 +185,8 @@ public override void SetColorBlock(Selectable selectable, Color? normal = null,
183
185
_highlightColorProp = high ;
184
186
if ( ReflectionUtility . GetPropertyInfo ( typeof ( ColorBlock ) , "pressedColor" ) is PropertyInfo pres && pres . CanWrite )
185
187
_pressedColorProp = pres ;
188
+ if ( ReflectionUtility . GetPropertyInfo ( typeof ( ColorBlock ) , "disabledColor" ) is PropertyInfo disa && disa . CanWrite )
189
+ _disabledColorProp = disa ;
186
190
}
187
191
188
192
try
@@ -210,6 +214,14 @@ public override void SetColorBlock(Selectable selectable, Color? normal = null,
210
214
else if ( ReflectionUtility . GetFieldInfo ( typeof ( ColorBlock ) , "m_PressedColor" ) is FieldInfo fi )
211
215
fi . SetValue ( boxed , ( Color ) pressed ) ;
212
216
}
217
+
218
+ if ( disabled != null )
219
+ {
220
+ if ( _disabledColorProp != null )
221
+ _disabledColorProp . SetValue ( boxed , ( Color ) disabled ) ;
222
+ else if ( ReflectionUtility . GetFieldInfo ( typeof ( ColorBlock ) , "m_DisabledColor" ) is FieldInfo fi )
223
+ fi . SetValue ( boxed , ( Color ) disabled ) ;
224
+ }
213
225
}
214
226
catch ( Exception ex )
215
227
{
0 commit comments