UseDrawer

  06. Attributes No Comments

Attribute that can be used to specify which drawer should be responsible for drawing the target class or class member in the inspector.

When you add this attribute to a class member, that class member will be drawn using the specified drawer, but only inside the class that holds the class member.

When you add this attribute to a class, that class will always be drawn using the specified drawer by default. This has the same outcome as when the DrawerForField attribute is used to make a drawer target a specific class type. This can be useful if you want to avoid modifying the drawer class.

Attribute Target

Class, field, property, method or indexer.

Example

using UnityEngine;
using Sisus;
using Sisus.Attributes;

public class StickyNote : MonoBehaviour
{
	[UseDrawer(typeof(StyledTextDrawer), "VCS_StickyNote"), TextArea]
	public string note = "(Add note here)";
}

Example Result