2022-09-16 14:18:06 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
|
|
|
|
|
namespace RimWorldAnimationStudio
|
|
|
|
|
{
|
|
|
|
|
[CustomEditor(typeof(KeyframeSlider))]
|
|
|
|
|
[CanEditMultipleObjects]
|
2022-10-12 05:22:29 +00:00
|
|
|
|
public class KeyframeSliderEditor : UnityEditor.UI.SliderEditor
|
2022-09-16 14:18:06 +00:00
|
|
|
|
{
|
|
|
|
|
SerializedProperty ghostSlidersProp;
|
|
|
|
|
SerializedProperty ghostSliderPrefabProp;
|
2022-09-20 06:03:55 +00:00
|
|
|
|
SerializedProperty handleImageProp;
|
|
|
|
|
SerializedProperty soundIconProp;
|
2022-09-16 14:18:06 +00:00
|
|
|
|
SerializedProperty maxGhostsProp;
|
|
|
|
|
|
|
|
|
|
protected override void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
base.OnEnable();
|
|
|
|
|
ghostSlidersProp = serializedObject.FindProperty("ghostSliders");
|
|
|
|
|
ghostSliderPrefabProp = serializedObject.FindProperty("ghostSliderPrefab");
|
2022-09-20 06:03:55 +00:00
|
|
|
|
handleImageProp = serializedObject.FindProperty("handleImage");
|
|
|
|
|
soundIconProp = serializedObject.FindProperty("soundIcon");
|
2022-09-16 14:18:06 +00:00
|
|
|
|
maxGhostsProp = serializedObject.FindProperty("maxGhosts");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnInspectorGUI()
|
|
|
|
|
{
|
|
|
|
|
EditorGUILayout.PropertyField(ghostSlidersProp, new GUIContent("Ghost Sliders"));
|
|
|
|
|
EditorGUILayout.PropertyField(ghostSliderPrefabProp, new GUIContent("Ghost Slider Prefab"));
|
2022-09-20 06:03:55 +00:00
|
|
|
|
EditorGUILayout.PropertyField(handleImageProp, new GUIContent("Handle Image"));
|
|
|
|
|
EditorGUILayout.PropertyField(soundIconProp, new GUIContent("Sound Icon"));
|
2022-09-16 14:18:06 +00:00
|
|
|
|
EditorGUILayout.PropertyField(maxGhostsProp, new GUIContent("Max Ghosts"));
|
|
|
|
|
|
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
|
|
|
base.OnInspectorGUI();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|