- Home /
 
 
               Question by 
               Stront · Aug 29, 2018 at 09:31 PM · 
                editorinspectorpropertydrawer  
              
 
              Custom PropertyDrawer in Array. Problem with expanding.
This is a simple script that does nothing. And I had a problem with the "expanding" (in inspector) elements of the array containing it. What is wrong?
Without custom script: 
 
With custom script: 
Custom PropertyDrawer code:
 [CustomPropertyDrawer(typeof(Pool))]
 public class PoolDrawer : PropertyDrawer
 {
     public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
     {
         EditorGUI.PropertyField(position, property, label, true);
     }
 
    
     public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
     {
         return EditorGUI.GetPropertyHeight(property);
     }
 }
 
               
                 
                propertydrawer-custom.gif 
                (144.2 kB) 
               
 
                
                 
                propertydrawer-default.gif 
                (189.1 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Property Drawers In Serializable Classes - GetPropertyHeight 2 Answers
Reset a SerializedProperty to it's default value. 2 Answers
How to show type text in EditorGUI.ObjectField? 1 Answer
Customizing Inspector variables. 2 Answers
How do I implement Draggable Properties with custom Labels in Editor or PropertyDrawer? 1 Answer