diff options
Diffstat (limited to 'Assets/ActionTool')
-rw-r--r-- | Assets/ActionTool/Editor/ActionEditor.cs | 6 | ||||
-rw-r--r-- | Assets/ActionTool/Editor/ActionNoteEditor.cs | 46 | ||||
-rw-r--r-- | Assets/ActionTool/Editor/ActionPreviewEditor.cs | 11 |
3 files changed, 43 insertions, 20 deletions
diff --git a/Assets/ActionTool/Editor/ActionEditor.cs b/Assets/ActionTool/Editor/ActionEditor.cs index a670f10b..b06ef89b 100644 --- a/Assets/ActionTool/Editor/ActionEditor.cs +++ b/Assets/ActionTool/Editor/ActionEditor.cs @@ -140,9 +140,9 @@ namespace ActionTool bool prevRichText = style.richText;
style.alignment = TextAnchor.MiddleCenter;
style.clipping = TextClipping.Clip;
- style.richText = true;
+ style.richText = false;
- m_AnimtionListScroll = EditorGUILayout.BeginScrollView(m_AnimtionListScroll);
+ m_AnimtionListScroll = EditorGUILayout.BeginScrollView(m_AnimtionListScroll);
for (int i = 0; i < animfiles.Length; ++i)
{
@@ -156,7 +156,7 @@ namespace ActionTool bool bChecked = ActionManager.CurrentAnimationName == animName;
EditorGUILayout.BeginHorizontal();
- bool check = GUILayout.Toggle(bChecked, animName, style, GUILayout.Width(position.width - 60), GUILayout.Height(15));
+ bool check = GUILayout.Toggle(bChecked, animName, style, GUILayout.Width(position.width - 60));
if (check && ActionManager.CurrentAnimationName != animName)
ActionManager.OnSelectAnimation(animName);
diff --git a/Assets/ActionTool/Editor/ActionNoteEditor.cs b/Assets/ActionTool/Editor/ActionNoteEditor.cs index fcc4e08a..d6a0a425 100644 --- a/Assets/ActionTool/Editor/ActionNoteEditor.cs +++ b/Assets/ActionTool/Editor/ActionNoteEditor.cs @@ -1,18 +1,40 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
+using UnityEditor;
-public class ActionNoteEditor : MonoBehaviour
+namespace ActionTool
{
- // Start is called before the first frame update
- void Start()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
-
- }
-}
+ // 编辑collider帧
+ public class ActionNoteEditor : EditorWindow
+ {
+ private void OnEnable()
+ {
+ titleContent = new GUIContent("Note");
+ maxSize = new Vector2(300, 110);
+ minSize = new Vector2(300, 110);
+ }
+
+ private void OnDisable()
+ {
+ }
+
+ private void Update()
+ {
+ }
+
+ private void OnGUI()
+ {
+ var animData = ActionManager.animationData;
+ if(animData == null)
+ {
+ this.Close();
+ return;
+ }
+ GUILayout.Space(5);
+ animData.note = GUILayout.TextArea(animData.note, GUILayout.Height(100));
+ GUILayout.Space(5);
+ }
+ }
+}
\ No newline at end of file diff --git a/Assets/ActionTool/Editor/ActionPreviewEditor.cs b/Assets/ActionTool/Editor/ActionPreviewEditor.cs index eb3c95ba..03858393 100644 --- a/Assets/ActionTool/Editor/ActionPreviewEditor.cs +++ b/Assets/ActionTool/Editor/ActionPreviewEditor.cs @@ -267,6 +267,7 @@ namespace ActionTool GUI.backgroundColor = animationData.note != null && animationData.note != "" ? bgColor : Color.gray;
if (GUI.Button(new Rect(xr + width + 10 + 50 + 10, y, 16, 14), "", styles.infoButton))
{
+ EditorWindow.GetWindow<ActionNoteEditor>(true);
}
GUI.backgroundColor = bgColor;
}
@@ -319,8 +320,8 @@ namespace ActionTool }
else if(animationData != null && animationData.overrideRootMotion == true)
{
- width = styles.textMiddle.CalcSize(new GUIContent("Override")).x;
- GUI.Label(new Rect(xr, y, width, 15), "Override", styles.textMiddle);
+ width = styles.textMiddleBold.CalcSize(new GUIContent("Override")).x;
+ GUI.Label(new Rect(xr, y, width, 15), "Override", styles.textMiddleBold);
if (GUI.Button(new Rect(xr + width + 10, y, 60, 15), "Edit"))
{
ActionManager.EditRootMotionOverrideData();
@@ -336,9 +337,10 @@ namespace ActionTool else
{
GUI.Label(new Rect(xr, y, 50, 15), "None", styles.textMiddleBold);
- if(animationData != null)
+ width = styles.textMiddleBold.CalcSize(new GUIContent("None")).x;
+ if (animationData != null)
{
- if (GUI.Button(new Rect(xr + 60 + 10 + 60, y, 60, 15), "Override"))
+ if (GUI.Button(new Rect(xr + width + 10, y, 60, 15), "Override"))
{
animationData.AddRootMotionOverriderData();
}
@@ -361,7 +363,6 @@ namespace ActionTool y += 15;
}
-
void GUI_Curve(ref float y)
{
AnimationData animData = ActionManager.animationData;
|