summaryrefslogtreecommitdiff
path: root/Erika/Assets/Tools/ActionTool/Editor/ActionPreviewEditor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Erika/Assets/Tools/ActionTool/Editor/ActionPreviewEditor.cs')
-rw-r--r--Erika/Assets/Tools/ActionTool/Editor/ActionPreviewEditor.cs40
1 files changed, 21 insertions, 19 deletions
diff --git a/Erika/Assets/Tools/ActionTool/Editor/ActionPreviewEditor.cs b/Erika/Assets/Tools/ActionTool/Editor/ActionPreviewEditor.cs
index 51a8194f..d6ad15d8 100644
--- a/Erika/Assets/Tools/ActionTool/Editor/ActionPreviewEditor.cs
+++ b/Erika/Assets/Tools/ActionTool/Editor/ActionPreviewEditor.cs
@@ -43,9 +43,11 @@ namespace ActionTool
const float kCurveYOffset = 80;
const float kTimeLineViewXOffset = 20;
float kTimeLineViewYOffset = 110;
- const float kFrameWidth = 10;
- const float kFrameHeight = 20;
+ float kFrameWidth { get { return 10 * m_GridZoom; } }
+ float kFrameHeight { get { return 20 * m_GridZoom; } }
+ const float kLabelWidth = 150;
+ float m_GridZoom = 1.3f;
float m_GridY = 0;
float m_ToolbarOffset = 0; // <= 0
bool m_ShowLeftButton;
@@ -251,9 +253,9 @@ namespace ActionTool
var actionData = ActionManager.actionData;
var animationData = ActionManager.animationData;
- float xl = 5, xr = xl + 105;
+ float xl = 5, xr = xl + kLabelWidth;
- GUI.Label(new Rect(xl, y, 105, 15), "Animation Name:", styles.textMiddle);
+ GUI.Label(new Rect(xl, y, kLabelWidth, 15), "Animation Name:", styles.textMiddle);
float width = styles.textMiddleBold.CalcSize(new GUIContent(ActionManager.CurrentAnimationName)).x;
GUI.Label(new Rect(xr, y, width, 15), ActionManager.CurrentAnimationName, styles.textMiddleBold);
if(GUI.Button(new Rect(xr + width + 10, y, 50, 15), "Info"))
@@ -277,7 +279,7 @@ namespace ActionTool
}
y += 15;
- GUI.Label(new Rect(xl, y, 105, 15), "AnimationData:", styles.textMiddle);
+ GUI.Label(new Rect(xl, y, kLabelWidth, 15), "AnimationData:", styles.textMiddle);
if(ActionManager.animationData != null)
{
width = styles.textMiddleBold.CalcSize(new GUIContent(ActionManager.AnimationDataPath)).x;
@@ -305,7 +307,7 @@ namespace ActionTool
}
y += 15;
- GUI.Label(new Rect(xl, y, 105, 15), "RootMotion:", styles.textMiddle);
+ GUI.Label(new Rect(xl, y, kLabelWidth, 15), "RootMotion:", styles.textMiddle);
if(actionData.rootMotion != null && (animationData == null || animationData.overrideRootMotion == false))
{
string content = ActionManager.actionData.rootMotionPath + " (Editor Only)";
@@ -378,8 +380,8 @@ namespace ActionTool
return;
float x = 5;
- GUI.Label(new Rect(x, y, 105, 15), "Speed Curve:", styles.textMiddle);
- x += 105;
+ GUI.Label(new Rect(x, y, kLabelWidth, 15), "Speed Curve:", styles.textMiddle);
+ x += kLabelWidth;
animData.speedCurve = EditorGUI.CurveField(new Rect(x, y, 210, 15), animData.speedCurve);
ui.DrawVerticalLineFast(x + 210 * ActionManager.actionData.curAnimTimeNormal, y , y + 15, Color.red);
y += 15;
@@ -392,8 +394,8 @@ namespace ActionTool
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, kLabelWidth, 15), "Properties:", styles.textMiddle);
+ x += kLabelWidth;
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"))
@@ -416,8 +418,8 @@ namespace ActionTool
return;
var settings = animData.actionSettings;
float x = 5;
- GUI.Label(new Rect(x, y, 105, 15), "Settings:", styles.textMiddle);
- x += 105;
+ GUI.Label(new Rect(x, y, kLabelWidth, 15), "Settings:", styles.textMiddle);
+ x += kLabelWidth;
if (GUI.Button(new Rect(x, y, 50, 15), "Edit"))
{
EditorWindow.GetWindow<ActionSettingsEditor>(true);
@@ -432,8 +434,8 @@ namespace ActionTool
return;
var parameters = animData.parameters;
float x = 5;
- GUI.Label(new Rect(x, y, 105, 15), "Parameters:", styles.textMiddle);
- x += 105;
+ GUI.Label(new Rect(x, y, kLabelWidth, 15), "Parameters:", styles.textMiddle);
+ x += kLabelWidth;
GUI.Label(new Rect(x, y, 10, 15), (parameters != null ? parameters.Count : 0).ToString(), styles.textMiddleBold);
x += 20;
if (GUI.Button(new Rect(x, y, 50, 15), "Edit"))
@@ -450,8 +452,8 @@ namespace ActionTool
return;
var toggles = animData.toggles;
float x = 5;
- GUI.Label(new Rect(x, y, 105, 15), "Toggles:", styles.textMiddle);
- x += 105;
+ GUI.Label(new Rect(x, y, kLabelWidth, 15), "Toggles:", styles.textMiddle);
+ x += kLabelWidth;
GUI.Label(new Rect(x, y, 10, 15), (toggles != null ? toggles.Count : 0).ToString(), styles.textMiddleBold);
//if(toggles != null && toggles.Count > 0)
//{
@@ -471,8 +473,8 @@ namespace ActionTool
return;
var curves = animData.curves;
float x = 5;
- GUI.Label(new Rect(x, y, 105, 15), "Curves:", styles.textMiddle);
- x += 105;
+ GUI.Label(new Rect(x, y, kLabelWidth, 15), "Curves:", styles.textMiddle);
+ x += kLabelWidth;
GUI.Label(new Rect(x, y, 10, 15), (curves != null ? curves.Count : 0).ToString(), styles.textMiddleBold);
x += 20;
if (GUI.Button(new Rect(x, y, 50, 15), "Edit"))
@@ -995,7 +997,7 @@ namespace ActionTool
bool frameSelect = GUI.Toggle(frameRect, isSelect, new GUIContent("", animEvent.Name), styles.keyFrameButton);
GUI.backgroundColor = prevColor;
- Rect labelRect = new Rect(pos.x, pos.y + 2, kFrameWidth, kFrameHeight);
+ Rect labelRect = new Rect(pos.x, pos.y + 5, kFrameWidth, kFrameHeight);
Color col = GUI.color;
GUI.color = Color.yellow;
GUI.Label(labelRect, animEvent.shortName, styles.textBoldSmall);