VR4RoboticArm2/VR4RoboticArm/Library/PackageCache/com.unity.learn.iet-framework/Editor/Property Drawers/UnityEventDrawer.cs
IonutMocanu 48cccc22ad Main2
2025-09-08 11:13:29 +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);
}
}
}