diff options
Diffstat (limited to 'Assets/ActionTool/Editor/ActionPreviewEditor.cs')
-rw-r--r-- | Assets/ActionTool/Editor/ActionPreviewEditor.cs | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/Assets/ActionTool/Editor/ActionPreviewEditor.cs b/Assets/ActionTool/Editor/ActionPreviewEditor.cs index 8c9d8f05..45048f0e 100644 --- a/Assets/ActionTool/Editor/ActionPreviewEditor.cs +++ b/Assets/ActionTool/Editor/ActionPreviewEditor.cs @@ -29,7 +29,8 @@ namespace ActionTool const float kToolbarControlMargin = 5;
const float kToolbarHeight = 50;
const float kToolbarControlSize = kToolbarHeight - kToolbarControlMargin * 2;
- const float kTimeLineViewXOffset = 30;
+ const float kTimeLineViewXOffset = 20;
+ const float kTimeLineViewYOffset = 80;
const float kFrameWidth = 10;
const float kFrameHeight = 20;
@@ -197,12 +198,27 @@ namespace ActionTool x += 200;
}
+ Vector2 scrollPos = Vector2.zero;
void GUI_TimeLineView()
{
if (ActionManager.actionData == null)
return;
- float y = 80;
+ ActionData action = ActionManager.actionData;
+
+ float y = kTimeLineViewYOffset;
+
+ float contentHeight = ActionManager.eventAndBoxCount * kFrameHeight + 40;
+ Rect content = new Rect(0, 0, action.totalFrame * kFrameWidth + 30, contentHeight);
+ float height = 300;
+ if (position.height - 80 > contentHeight)
+ height = contentHeight + 15;
+ else
+ height = position.height - 80;
+ Rect viewport = new Rect(0, y, position.width, height);
+ scrollPos = GUI.BeginScrollView(viewport, scrollPos, content);
+
+ y = 0;
GUI_FrameText(ref y);
GUI_Slider(ref y);
@@ -210,6 +226,8 @@ namespace ActionTool GUI_Events();
GUI_Boxes();
GUI_FrameLine();
+
+ GUI.EndScrollView();
}
void GUI_FrameText(ref float y)
@@ -434,7 +452,7 @@ namespace ActionTool {
x += kToolbarControlMargin;
Rect rect = new Rect(x, y, kToolbarControlSize, kToolbarControlSize);
- if (GUI.Button(rect, new GUIContent("New", m_UITextureNewHurtBox)))
+ if (GUI.Button(rect, new GUIContent(" + ", m_UITextureNewHurtBox, "New hurt box")))
{
ActionManager.NewHurtBox();
}
@@ -445,7 +463,7 @@ namespace ActionTool {
x += kToolbarControlMargin;
Rect rect = new Rect(x, y, kToolbarControlSize, kToolbarControlSize);
- if (GUI.Button(rect, new GUIContent("New", m_UITextureNewHitBox)))
+ if (GUI.Button(rect, new GUIContent(" + ", m_UITextureNewHitBox, "New hit box")))
{
ActionManager.NewHitBox();
}
@@ -457,7 +475,7 @@ namespace ActionTool x += kToolbarControlMargin;
Rect rect = new Rect(x, y, kToolbarControlSize, kToolbarControlSize);
GUI.enabled = ActionManager.colliderData != null;
- if (GUI.Button(rect, "Delete"))
+ if (GUI.Button(rect, new GUIContent(styles.deleteIcon, "Delete this collider")))
{
ActionManager.DeleteCurBox();
}
@@ -469,7 +487,7 @@ namespace ActionTool {
x += kToolbarControlMargin;
Rect rect = new Rect(x, y, kToolbarControlSize, kToolbarControlSize);
- if (GUI.Button(rect, new GUIContent("New")))
+ if (GUI.Button(rect, new GUIContent(styles.addFileIcon, "Add new animation data file")))
{
ActionManager.CreateAnimationData();
}
@@ -480,7 +498,7 @@ namespace ActionTool {
x += kToolbarControlMargin;
Rect rect = new Rect(x, y, kToolbarControlSize, kToolbarControlSize);
- if (GUI.Button(rect, new GUIContent("Save")))
+ if (GUI.Button(rect, new GUIContent(styles.saveFileIcon, "Save")))
{
ActionManager.SaveAnimationData();
}
|