rimworld-animation-studio/Assets/Editor/KeyframeSliderEditor.cs
2022-09-16 09:18:06 -05:00

32 lines
1.1 KiB
C#

using UnityEngine;
using UnityEditor;
namespace RimWorldAnimationStudio
{
[CustomEditor(typeof(KeyframeSlider))]
[CanEditMultipleObjects]
public class MenuButtonEditor : UnityEditor.UI.SliderEditor
{
SerializedProperty ghostSlidersProp;
SerializedProperty ghostSliderPrefabProp;
SerializedProperty maxGhostsProp;
protected override void OnEnable()
{
base.OnEnable();
ghostSlidersProp = serializedObject.FindProperty("ghostSliders");
ghostSliderPrefabProp = serializedObject.FindProperty("ghostSliderPrefab");
maxGhostsProp = serializedObject.FindProperty("maxGhosts");
}
public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(ghostSlidersProp, new GUIContent("Ghost Sliders"));
EditorGUILayout.PropertyField(ghostSliderPrefabProp, new GUIContent("Ghost Slider Prefab"));
EditorGUILayout.PropertyField(maxGhostsProp, new GUIContent("Max Ghosts"));
serializedObject.ApplyModifiedProperties();
base.OnInspectorGUI();
}
}
}