From 5f9bce715954b5b6e2db1168f0a065cce23f5519 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 5 Aug 2021 17:32:37 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionPreviewEditor.cs | 56 ++++++++++++++++++------- 1 file changed, 41 insertions(+), 15 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionPreviewEditor.cs') diff --git a/Assets/ActionTool/Editor/ActionPreviewEditor.cs b/Assets/ActionTool/Editor/ActionPreviewEditor.cs index 98c0245b..dc855fad 100644 --- a/Assets/ActionTool/Editor/ActionPreviewEditor.cs +++ b/Assets/ActionTool/Editor/ActionPreviewEditor.cs @@ -234,19 +234,45 @@ namespace ActionTool y += 15; GUI.Label(new Rect(xl, y, 105, 15), "AnimationData:", styles.textMiddle); - width = styles.textMiddleBold.CalcSize(new GUIContent(ActionManager.AnimationDataPath)).x; - GUI.Label(new Rect(xr, y, width, 15), ActionManager.AnimationDataPath, styles.textMiddleBold); - if (GUI.Button(new Rect(xr + width + 10, y, 50, 15), "Info")) - { - AnimationData animData = ActionManager.animationData; - ActionInfoEditor.ShowContent("AnimationData Info", - "Events: " + (animData.animationEvents == null ? 0 : animData.animationEvents.Count )+ "\n" + - "HurtBoxes: " + (animData.hurtBoxes == null ? 0 : animData.hurtBoxes.Count) + "\n" + - "HitBoxes: " + (animData.hitBoxes == null ? 0 : animData.hitBoxes.Count) + "\n" + - "ThrowBoxes: " + (animData.throwBoxes == null ? 0 : animData.throwBoxes.Count) + "\n" + - "BlockBoxes: " + (animData.blockBoxes == null ? 0 : animData.blockBoxes.Count) + "\n" + - "DefendBoxes: " + (animData.defendBoxes == null ? 0 : animData.defendBoxes.Count) - ); + if(ActionManager.animationData != null) + { + width = styles.textMiddleBold.CalcSize(new GUIContent(ActionManager.AnimationDataPath)).x; + GUI.Label(new Rect(xr, y, width, 15), ActionManager.AnimationDataPath, styles.textMiddleBold); + if (GUI.Button(new Rect(xr + width + 10, y, 50, 15), "Info")) + { + AnimationData animData = ActionManager.animationData; + ActionInfoEditor.ShowContent("AnimationData Info", + "Events: " + (animData.animationEvents == null ? 0 : animData.animationEvents.Count) + "\n" + + "HurtBoxes: " + (animData.hurtBoxes == null ? 0 : animData.hurtBoxes.Count) + "\n" + + "HitBoxes: " + (animData.hitBoxes == null ? 0 : animData.hitBoxes.Count) + "\n" + + "ThrowBoxes: " + (animData.throwBoxes == null ? 0 : animData.throwBoxes.Count) + "\n" + + "BlockBoxes: " + (animData.blockBoxes == null ? 0 : animData.blockBoxes.Count) + "\n" + + "DefendBoxes: " + (animData.defendBoxes == null ? 0 : animData.defendBoxes.Count) + ); + } + } + else + { + GUI.Label(new Rect(xr, y, 100, 15), "None", styles.textMiddleBold); + } + y += 15; + + GUI.Label(new Rect(xl, y, 105, 15), "RootMotion:", styles.textMiddle); + if(ActionManager.actionData.rootMotion != null) + { + width = styles.textMiddleBold.CalcSize(new GUIContent(ActionManager.actionData.rootMotionPath)).x; + GUI.Label(new Rect(xr, y, width, 15), ActionManager.actionData.rootMotionPath, styles.textMiddleBold); + if (GUI.Button(new Rect(xr + width + 10, y, 50, 15), "Info")) + { + RootMotionData rootMotion = ActionManager.actionData.rootMotion; + ActionInfoEditor.ShowContent("RootMotion Info", + "Frame Count: " + rootMotion.frameCount + ); + } + } + else + { + GUI.Label(new Rect(xr, y, 100, 15), "None", styles.textMiddleBold); } y += 15; @@ -299,8 +325,8 @@ namespace ActionTool float contentHeight = ActionManager.eventAndBoxCount * kFrameHeight + 40; Rect content = new Rect(0, 0, action.totalFrame * kFrameWidth + 30, contentHeight); float height = 300; - if (position.height - kTimeLineViewYOffset > contentHeight) - height = contentHeight; + if (position.height - kTimeLineViewYOffset > contentHeight + 15) + height = contentHeight + 15; else height = position.height - kTimeLineViewYOffset; Rect viewport = new Rect(0, y, position.width, height); -- cgit v1.1-26-g67d0