internal static void LayerMaskField(Rect position, SerializedProperty property, GUIContent label, GUIStyle style)
 {
   int controlId = GUIUtility.GetControlID(EditorGUI.s_LayerMaskField, EditorGUIUtility.native, position);
   position = EditorGUI.PrefixLabel(position, controlId, label);
   Event current = Event.current;
   if (current.type == EventType.Repaint)
   {
     if (EditorGUI.showMixedValue)
     {
       EditorGUI.BeginHandleMixedValueContentColor();
       style.Draw(position, EditorGUI.s_MixedValueContent, controlId, false);
       EditorGUI.EndHandleMixedValueContentColor();
     }
     else
       style.Draw(position, EditorGUIUtility.TempContent(property.layerMaskStringValue), controlId, false);
   }
   else
   {
     if ((current.type != EventType.MouseDown || !position.Contains(current.mousePosition)) && !current.MainActionKeyForControl(controlId))
       return;
     SerializedProperty property1 = property.serializedObject.FindProperty(property.propertyPath);
     EditorUtility.DisplayCustomMenu(position, property.GetLayerMaskNames(), !property.hasMultipleDifferentValues ? property.GetLayerMaskSelectedIndex() : new int[0], new EditorUtility.SelectMenuItemFunction(EditorGUI.SetLayerMaskValueDelegate), (object) property1);
     Event.current.Use();
   }
 }