From 6d1a959a63407c38de4be2870bd0cf46a6d789c5 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 11 Sep 2021 11:37:35 +0800 Subject: *action tool --- Assets/ActionTool/Editor/ActionPreviewEditor.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionPreviewEditor.cs') diff --git a/Assets/ActionTool/Editor/ActionPreviewEditor.cs b/Assets/ActionTool/Editor/ActionPreviewEditor.cs index 4fd776cc..a305ad72 100644 --- a/Assets/ActionTool/Editor/ActionPreviewEditor.cs +++ b/Assets/ActionTool/Editor/ActionPreviewEditor.cs @@ -472,7 +472,7 @@ namespace ActionTool float y = iy; float contentHeight = ActionManager.GridRowCount * kFrameHeight + 40; - Rect content = new Rect(0, 0, ((int)action.totalFrame + 1)* kFrameWidth + 30, contentHeight); + Rect content = new Rect(0, 0, ((int)Mathf.Ceil(action.totalFrame)) * kFrameWidth + 30, contentHeight); float height = 300; if (position.height - kTimeLineViewYOffset > contentHeight + 15) height = contentHeight + 15; @@ -497,7 +497,7 @@ namespace ActionTool void GUI_FrameText(ref float y) { ActionData action = ActionManager.actionData; - int sampleCount = (int)action.totalFrame + 1; + int sampleCount = (int)Mathf.Ceil(action.totalFrame); Rect rect = new Rect(0, y, 20, 15); for(int i = 0; i < sampleCount; i++) { @@ -538,7 +538,7 @@ namespace ActionTool m_GridY = y; ActionData action = ActionManager.actionData; - int sampleCount = (int)action.totalFrame + 1; + int sampleCount = (int)Mathf.Ceil(action.totalFrame); Rect bgRect = new Rect(kTimeLineViewXOffset, y, sampleCount * kFrameWidth, ActionManager.GridRowCount * kFrameHeight); GUI.Box(bgRect, ""); @@ -701,7 +701,7 @@ namespace ActionTool return; ActionData action = ActionManager.actionData; AnimationData animData = ActionManager.animationData; - int sampleCount = (int)action.totalFrame + 1; + int sampleCount = (int)Mathf.Ceil(action.totalFrame); float y = m_GridY + (ActionManager.MaxEventsPerFrame + 1) * kFrameHeight + (animData.overrideRootMotion ? kFrameHeight : 0); Vector2 position = e.mousePosition; int boxCount = ActionManager.animationData.GetBoxesCount(); @@ -977,7 +977,7 @@ namespace ActionTool return; ActionData action = ActionManager.actionData; - int sampleCount = (int)action.totalFrame + 1; + int sampleCount = (int)Mathf.Ceil(action.totalFrame); Vector2 position = Event.current.mousePosition; Rect eventRegion = new Rect(kTimeLineViewXOffset, m_GridY, sampleCount * kFrameWidth, (ActionManager.MaxEventsPerFrame + 1) * kFrameHeight); if (!eventRegion.Contains(position)) -- cgit v1.1-26-g67d0