diff options
Diffstat (limited to 'Assets/ActionTool')
-rw-r--r-- | Assets/ActionTool/Editor/ActionPreviewEditor.cs | 29 | ||||
-rw-r--r-- | Assets/ActionTool/Editor/AnimationPropertyEditor.cs | 54 | ||||
-rw-r--r-- | Assets/ActionTool/Editor/AnimationPropertyEditor.cs.meta | 11 |
3 files changed, 90 insertions, 4 deletions
diff --git a/Assets/ActionTool/Editor/ActionPreviewEditor.cs b/Assets/ActionTool/Editor/ActionPreviewEditor.cs index c9358f98..a52a87ff 100644 --- a/Assets/ActionTool/Editor/ActionPreviewEditor.cs +++ b/Assets/ActionTool/Editor/ActionPreviewEditor.cs @@ -113,6 +113,7 @@ namespace ActionTool float y = kToolbarHeight + 5;
GUI_Detail(ref y);
+ GUI_Properties(ref y);
GUI_Parameters(ref y);
GUI_Toggle(ref y);
GUI_Curves(ref y);
@@ -341,12 +342,14 @@ namespace ActionTool {
float xl = 5, xr = xl + 105;
GUI.Label(new Rect(xl, y, 105, 15), "Playback Frame:", styles.textMiddle);
- GUI.Label(new Rect(xr, y, 510, 15), ActionManager.actionData.curAnimFrame.ToString("f2"), styles.textMiddleBold);
+ GUI.Label(new Rect(xr, y, 110, 15), ActionManager.actionData.curAnimFrame.ToString("f2"), styles.textMiddleBold);
GUI.Label(new Rect(xl + 150, y, 105, 15), "Normalized Time:", styles.textMiddle);
- GUI.Label(new Rect(xr + 150, y, 510, 15), ActionManager.actionData.curAnimTimeNormal.ToString("f2"), styles.textMiddleBold);
+ GUI.Label(new Rect(xr + 150, y, 110, 15), ActionManager.actionData.curAnimTimeNormal.ToString("f2"), styles.textMiddleBold);
GUI.Label(new Rect(xl + 150 * 2, y, 105, 15), "Event Frame:", styles.textMiddle);
- GUI.Label(new Rect(xr + 150 + 125, y, 510, 15), ((int)ActionManager.actionData.curAnimFrame).ToString(), styles.textMiddleBold);
- y += 15;
+ GUI.Label(new Rect(xr + 150 + 125, y, 110, 15), ((int)ActionManager.actionData.curAnimFrame).ToString(), styles.textMiddleBold);
+ GUI.Label(new Rect(xl + 150 + 130 + 130, y, 105, 15), "Time:", styles.textMiddle);
+ GUI.Label(new Rect(xr + 150 + 130 + 70 , y, 510, 15), ((int)ActionManager.actionData.curAnimFrame).ToString(), styles.textMiddleBold);
+ y += 15;
}
@@ -364,6 +367,24 @@ namespace ActionTool y += 15;
}
+ void GUI_Properties(ref float y)
+ {
+ AnimationData animData = ActionManager.animationData;
+ if (animData == null)
+ return;
+ var properties = animData.properties;
+ float x = 5;
+ GUI.Label(new Rect(x, y, 105, 15), "Properties:", styles.textMiddle);
+ x += 105;
+ GUI.Label(new Rect(x, y, 10, 15), (properties != null ? properties.Count : 0).ToString(), styles.textMiddleBold);
+ x += 20;
+ if (GUI.Button(new Rect(x, y, 50, 15), "Edit"))
+ {
+ EditorWindow.GetWindow<AnimationPropertyEditor>(true);
+ }
+ y += 15;
+ }
+
void GUI_Parameters(ref float y)
{
AnimationData animData = ActionManager.animationData;
diff --git a/Assets/ActionTool/Editor/AnimationPropertyEditor.cs b/Assets/ActionTool/Editor/AnimationPropertyEditor.cs new file mode 100644 index 00000000..59786bf9 --- /dev/null +++ b/Assets/ActionTool/Editor/AnimationPropertyEditor.cs @@ -0,0 +1,54 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace ActionTool +{ + + [CustomPropertyDrawer(typeof(PropertyDictionary))] + public class PropertyDictionaryDrawer : SerializableDictionaryPropertyDrawer { } + + public class AnimationPropertyEditor : EditorWindow + { + + SerializedObject obj; + + private void OnEnable() + { + titleContent = new GUIContent("Properties"); + minSize = new Vector2(300, 200); + maxSize = new Vector2(300, 2000); + } + + 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("properties"); + EditorGUILayout.PropertyField(curves, true); + if (obj.ApplyModifiedProperties()) + { + } + } + } + +} diff --git a/Assets/ActionTool/Editor/AnimationPropertyEditor.cs.meta b/Assets/ActionTool/Editor/AnimationPropertyEditor.cs.meta new file mode 100644 index 00000000..efdc8fad --- /dev/null +++ b/Assets/ActionTool/Editor/AnimationPropertyEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac9aacf41a77d2d4b8dbda78defdf534 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |