Table of Contents

Class SimplePropertyDrawer

Namespace
CodeBase.Samples
Assembly
4Experience.CodeBase.Samples.Editor.dll

An example of a simple property drawer implementation. It is possible to preview how to make a custom property drawer script.

[CustomPropertyDrawer(typeof(SimpleAttribute))]
public class SimplePropertyDrawer : BasePropertyDrawer
Inheritance
GUIDrawer
PropertyDrawer
SimplePropertyDrawer
Inherited Members
Extension Methods

Methods

OnGUI(Rect, SerializedProperty, GUIContent)

Overriding this method allows you to draw properties for a given attribute according to its implementation. How to implement simple property drawer?

GUIElementsSettings settings = GUIElementsSettings.Instance;
DrawSimpleEnum(position, property, label, settings, settings.GetTextMeshProFontDataIndex(property.stringValue), settings.GetTextMeshProFontDataNames());

References: https://docs.unity3d.com/ScriptReference/PropertyDrawer.html

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

Parameters

position Rect
property SerializedProperty
label GUIContent