Rasagar/Library/PackageCache/com.unity.visualeffectgraph/Editor/Utilities/ExposedProperty/ExposedPropertyDrawer.cs
2024-08-26 23:07:20 +03:00

24 lines
823 B
C#

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)));
}
}
}