VR4Medical/ICI/Library/PackageCache/com.unity.learn.iet-framework@4bd5247958fc/Editor/Property Drawers/UnityEventDrawer.cs
2025-07-29 13:45:50 +03:00

28 lines
822 B
C#

using UnityEditor;
using UnityEngine;
using UnityEngine.Events;
namespace Unity.Tutorials.Core.Editor
{
/// <summary>
/// Used to work around the fact that the default UnityEventDrawer doesn't support tooltips for the header content.
/// </summary>
[CustomPropertyDrawer(typeof(UnityEventBase), true)]
class UnityEventDrawer : UnityEditorInternal.UnityEventDrawer
{
GUIContent m_Label;
protected override void DrawEventHeader(Rect headerRect)
{
headerRect.height = EditorGUIUtility.singleLineHeight;
GUI.Label(headerRect, m_Label);
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
m_Label = label;
base.OnGUI(position, property, label);
}
}
}