rimworld-animation-studio/Assets/Editor/ButtonWithKeyCodeEditor.cs
AbstractConcept 3d859555ad UI 2.0
2022-10-12 00:22:29 -05:00

26 lines
681 B
C#

using UnityEngine;
using UnityEditor;
namespace RimWorldAnimationStudio
{
[CustomEditor(typeof(ButtonWithKeyCode))]
[CanEditMultipleObjects]
public class ButtonWithKeyCodeEditor : UnityEditor.UI.ButtonEditor
{
SerializedProperty keyCodeProp;
protected override void OnEnable()
{
base.OnEnable();
keyCodeProp = serializedObject.FindProperty("keyCode");
}
public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(keyCodeProp, new GUIContent("KeyCode"));
serializedObject.ApplyModifiedProperties();
base.OnInspectorGUI();
}
}
}