From adb364a79f5dd69de08f72072cc2261131314e53 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 2 Sep 2021 13:01:49 +0800 Subject: +override rootmotion --- Assets/ActionTool/Editor/ActionManager.cs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionManager.cs') diff --git a/Assets/ActionTool/Editor/ActionManager.cs b/Assets/ActionTool/Editor/ActionManager.cs index 52311140..7c3f1df4 100644 --- a/Assets/ActionTool/Editor/ActionManager.cs +++ b/Assets/ActionTool/Editor/ActionManager.cs @@ -28,6 +28,7 @@ namespace ActionTool public static ActionEventEditor EventEditWindow; public static ActionColliderFrameEditor ColliderFrameWindow; public static ActionColliderEditor ColliderWindow; + public static ActionRootMotionEditor RootMotionEditor; public static ActionToolSettings Settings; @@ -115,12 +116,22 @@ namespace ActionTool private static GameObject s_RootActionTool; private const string kRootActionTool = "RootActionTool"; - public const int kMaxEventsPerFrame = 10; - public static int eventAndBoxCount + public static int MaxEventsPerFrame // 所有帧里面事件最多有几个 { get { - return kMaxEventsPerFrame + (animationData != null ? animationData.GetBoxesCount() : 0); + if (animationData == null) + return 0; + return animationData.GetMaxAnimationEventsCount(); + } + } + + public static int GridRowCount + { + get + { + bool hasRM = animationData != null && animationData.overrideRootMotion != null; + return (MaxEventsPerFrame + 1) + (animationData != null ? animationData.GetBoxesCount() : 0) + (hasRM ? 1 : 0); } } @@ -481,5 +492,10 @@ namespace ActionTool animationData.DeleteEvent(animEvent); } + public static void EditRootMotionOverrideData() + { + RootMotionEditor = EditorWindow.GetWindow(true); + } + } } \ No newline at end of file -- cgit v1.1-26-g67d0