Skip to content

ValueReferenceDrawer Class

C#
[CustomPropertyDrawer(typeof(ValueReference<>), true)]
public sealed class ValueReferenceDrawer : PropertyDrawer

Inheritance object → UnityEditor.GUIDrawer → UnityEditor.PropertyDrawer

Creates custom GUI with UI Toolkit for the property.

C#
public override VisualElement CreatePropertyGUI(SerializedProperty property)

property UnityEditor.SerializedProperty
The SerializedProperty to make the custom GUI for.

UnityEngine.UIElements.VisualElement

The element containing the custom GUI.

OnGUI(Rect, SerializedProperty, GUIContent)

Section titled “OnGUI(Rect, SerializedProperty, GUIContent)”

Override this method to make your own IMGUI based GUI for the property.

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

position UnityEngine.Rect
Rectangle on the screen to use for the property GUI.

property UnityEditor.SerializedProperty
The SerializedProperty to make the custom GUI for.

label UnityEngine.GUIContent
The label of this property.