@@ -63,7 +63,6 @@ public sealed partial class EditorGUI
6363 private static readonly int s_ColorHash = "s_ColorHash" . GetHashCode ( ) ;
6464 private static readonly int s_CurveHash = "s_CurveHash" . GetHashCode ( ) ;
6565 private static readonly int s_LayerMaskField = "s_LayerMaskField" . GetHashCode ( ) ;
66- private static readonly int s_RenderingLayerMaskField = "s_RenderingLayerMaskField" . GetHashCode ( ) ;
6766 private static readonly int s_MaskField = "s_MaskField" . GetHashCode ( ) ;
6867 private static readonly int s_EnumFlagsField = "s_EnumFlagsField" . GetHashCode ( ) ;
6968 private static readonly int s_GenericField = "s_GenericField" . GetHashCode ( ) ;
@@ -6606,7 +6605,7 @@ public static void HelpBox(Rect position, GUIContent content)
66066605 if ( content . image != null )
66076606 {
66086607 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 ) ;
66106609 labelRect . x += iconSize ;
66116610 labelRect . width -= iconSize ;
66126611
@@ -7139,40 +7138,6 @@ internal static uint LayerMaskField(Rect position, UInt32 layers, SerializedProp
71397138 return unchecked ( ( uint ) newValue ) ;
71407139 }
71417140
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-
71767141 // Helper function for helping with debugging the editor
71777142 internal static void ShowRepaints ( )
71787143 {
@@ -7716,6 +7681,23 @@ internal static bool DefaultPropertyField(Rect position, SerializedProperty prop
77167681 }
77177682 break ;
77187683 }
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+ }
77197701 case SerializedPropertyType . Character :
77207702 {
77217703 char [ ] value = { ( char ) property . intValue } ;
0 commit comments