UP-Viagg-io/Viagg-io/Assets/Packages/DefaultPlayables/ScreenFader/Editor/ScreenFaderDrawer.cs

23 lines
776 B
C#
Raw Normal View History

2024-05-15 13:18:09 +02:00
using UnityEditor;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.UI;
[CustomPropertyDrawer(typeof(ScreenFaderBehaviour))]
public class ScreenFaderDrawer : PropertyDrawer
{
public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
{
int fieldCount = 1;
return fieldCount * EditorGUIUtility.singleLineHeight;
}
public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
SerializedProperty colorProp = property.FindPropertyRelative("color");
Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
EditorGUI.PropertyField(singleFieldRect, colorProp);
}
}