Skip to content

Property View

  1. Create new folder and name it Editor.
  2. Inside Editor folder create new class, ExampleView.cs

    public class ExampleView
    {
    
    }
    

  3. Inherit from PropertyView class.

    public class ExampleView : PropertyView
    {
    
    }
    

  4. Implement abstract method OnGUI.

    public class ExampleView : PropertyView
    {
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            // Property GUI here...
        }
    }
    

  5. Add ViewTarget attribute and set ExampleAttribute as target to this view.

    [ViewTarget(typeof(ExampleAttribute))]
    public class ExampleView : PropertyView
    {
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            // Property GUI here...
        }
    }