Files
CartoonRPG/Library/PackageCache/com.unity.visualeffectgraph@2973a8ac1070/Editor/Utilities/ExposedProperty/ExposedPropertyDrawer.cs

24 lines
823 B
C#
Raw Normal View History

2025-06-05 22:59:18 +01:00
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.VFX.Utility;
namespace UnityEditor.VFX.Utility
{
[CustomPropertyDrawer(typeof(ExposedProperty))]
class ExposedPropertyDrawer : PropertyDrawer
{
const string k_PropertyName = "m_Name";
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
return new PropertyField(property.FindPropertyRelative(k_PropertyName), ObjectNames.NicifyVariableName(property.name));
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.PropertyField(position, property.FindPropertyRelative(k_PropertyName), new GUIContent(ObjectNames.NicifyVariableName(property.name)));
}
}
}