From 7669c3afcbd71f06233bce12bb521c582c07ee5b Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 9 Aug 2021 08:47:48 +0800 Subject: *misc --- .../ActionTool/Editor/AnimationParameterEditor.cs | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Assets/ActionTool/Editor/AnimationParameterEditor.cs (limited to 'Assets/ActionTool/Editor/AnimationParameterEditor.cs') diff --git a/Assets/ActionTool/Editor/AnimationParameterEditor.cs b/Assets/ActionTool/Editor/AnimationParameterEditor.cs new file mode 100644 index 00000000..4a382170 --- /dev/null +++ b/Assets/ActionTool/Editor/AnimationParameterEditor.cs @@ -0,0 +1,54 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace ActionTool +{ + + [CustomPropertyDrawer(typeof(ParameterDictionary))] + public class ParameterDictionaryDrawer : SerializableDictionaryPropertyDrawer { } + + public class AnimationParameterEditor : EditorWindow + { + + SerializedObject obj; + + private void OnEnable() + { + titleContent = new GUIContent("Parameters"); + maxSize = new Vector2(300, 200); + minSize = maxSize; + } + + private void OnDisable() + { + } + + private void Update() + { + } + + private void OnGUI() + { + AnimationData animData = ActionManager.animationData; + if (animData == null) + { + this.Close(); + return; + } + + if (obj == null || obj.targetObject != animData) + { + obj = new SerializedObject(animData); + } + + var curves = obj.FindProperty("parameters"); + EditorGUILayout.PropertyField(curves, true); + if (obj.ApplyModifiedProperties()) + { + } + } + } + +} -- cgit v1.1-26-g67d0