@@ -63,7 +63,6 @@ public sealed partial class EditorGUI
63
63
private static readonly int s_ColorHash = "s_ColorHash" . GetHashCode ( ) ;
64
64
private static readonly int s_CurveHash = "s_CurveHash" . GetHashCode ( ) ;
65
65
private static readonly int s_LayerMaskField = "s_LayerMaskField" . GetHashCode ( ) ;
66
- private static readonly int s_RenderingLayerMaskField = "s_RenderingLayerMaskField" . GetHashCode ( ) ;
67
66
private static readonly int s_MaskField = "s_MaskField" . GetHashCode ( ) ;
68
67
private static readonly int s_EnumFlagsField = "s_EnumFlagsField" . GetHashCode ( ) ;
69
68
private static readonly int s_GenericField = "s_GenericField" . GetHashCode ( ) ;
@@ -6606,7 +6605,7 @@ public static void HelpBox(Rect position, GUIContent content)
6606
6605
if ( content . image != null )
6607
6606
{
6608
6607
var labelRect = position ;
6609
- int iconSize = ( int ) ( content . image . width / EditorGUIUtility . pixelsPerPoint ) + EditorStyles . helpBox . padding . right ;
6608
+ int iconSize = ( int ) ( content . image . width / EditorGUIUtility . pixelsPerPoint ) ;
6610
6609
labelRect . x += iconSize ;
6611
6610
labelRect . width -= iconSize ;
6612
6611
@@ -7139,40 +7138,6 @@ internal static uint LayerMaskField(Rect position, UInt32 layers, SerializedProp
7139
7138
return unchecked ( ( uint ) newValue ) ;
7140
7139
}
7141
7140
7142
- // Make a field for rendering layer masks.
7143
- internal static void RenderingLayerMaskField ( Rect position , SerializedProperty property , GUIContent label , GUIStyle style )
7144
- {
7145
- RenderingLayerMaskField ( position , property . uintValue , property , label , style ) ;
7146
- }
7147
-
7148
- internal static void RenderingLayerMaskField ( Rect position , SerializedProperty property , GUIContent label )
7149
- {
7150
- RenderingLayerMaskField ( position , property . uintValue , property , label , EditorStyles . layerMaskField ) ;
7151
- }
7152
-
7153
- internal static RenderingLayerMask RenderingLayerMaskField ( Rect position , RenderingLayerMask layers , GUIContent label )
7154
- {
7155
- return RenderingLayerMaskField ( position , layers , null , label , EditorStyles . layerMaskField ) ;
7156
- }
7157
-
7158
- internal static uint RenderingLayerMaskField ( Rect position , UInt32 layers , SerializedProperty property , GUIContent label , GUIStyle style )
7159
- {
7160
- var id = GUIUtility . GetControlID ( s_RenderingLayerMaskField , FocusType . Keyboard , position ) ;
7161
- if ( label != null )
7162
- position = PrefixLabel ( position , id , label ) ;
7163
-
7164
- TagManager . GetDefinedRenderingLayers ( out var renderingLayerNames , out var renderingLayerValues ) ;
7165
-
7166
- using var scope = new MixedValueScope ( ) ;
7167
-
7168
- BeginChangeCheck ( ) ;
7169
- var newValue = MaskFieldGUI . DoMaskField ( position , id , unchecked ( ( int ) layers ) , renderingLayerNames , renderingLayerValues , style ) ;
7170
- if ( EndChangeCheck ( ) && property != null )
7171
- property . FindPropertyRelative ( "m_Bits" ) . uintValue = ( uint ) newValue ;
7172
-
7173
- return unchecked ( ( uint ) newValue ) ;
7174
- }
7175
-
7176
7141
// Helper function for helping with debugging the editor
7177
7142
internal static void ShowRepaints ( )
7178
7143
{
@@ -7716,6 +7681,23 @@ internal static bool DefaultPropertyField(Rect position, SerializedProperty prop
7716
7681
}
7717
7682
break ;
7718
7683
}
7684
+ case SerializedPropertyType . RenderingLayerMask :
7685
+ {
7686
+ var names = RenderingLayerMask . GetDefinedRenderingLayerNames ( ) ;
7687
+ var values = RenderingLayerMask . GetDefinedRenderingLayerValues ( ) ;
7688
+ MaskFieldGUI . GetMaskButtonValue ( ( int ) property . uintValue , names , values , out var toggleLabel , out var toggleLabelMixed ) ;
7689
+ if ( label != null )
7690
+ position = PrefixLabel ( position , label , EditorStyles . label ) ;
7691
+
7692
+ var toggleLabelContent = property . hasMultipleDifferentValues ? mixedValueContent : MaskFieldGUI . DoMixedLabel ( toggleLabel , toggleLabelMixed , position , EditorStyles . layerMaskField ) ;
7693
+ bool toggled = DropdownButton ( position , toggleLabelContent , FocusType . Keyboard , EditorStyles . layerMaskField ) ;
7694
+ if ( toggled )
7695
+ {
7696
+ PopupWindowWithoutFocus . Show ( position , new MaskFieldDropDown ( property ) ) ;
7697
+ GUIUtility . ExitGUI ( ) ;
7698
+ }
7699
+ break ;
7700
+ }
7719
7701
case SerializedPropertyType . Character :
7720
7702
{
7721
7703
char [ ] value = { ( char ) property . intValue } ;
0 commit comments