Skip to content

Painters

Property painter attributes can add additional visual elements on property.

Info

Each property can have multiple property painters.

Demo

Let’s create GameObject field. And add to this field default Cube primitive.

using UnityEngine;

public class ExampleComponent : MonoBehaviour
{
    public GameObject someObject;
}

Live-demo

Default GameObject view

Let’s add [ObjectPreview] attribute and set attribute parameter «expandable» on true. [ObjectPreview(true)]

Note

Make sure that you have added ApexInspector namespace in your script, to get access to all attributes.

using ApexInspector;

using ApexInspector;
using UnityEngine;

public class ExampleComponent : MonoBehaviour
{
    [ObjectPreview(true)]
    public GameObject someObject;
}

Live-demo

GameObject field after using Apex [ObjectPreview] painter attribute