summaryrefslogtreecommitdiff
path: root/Assets/ActionTool/Editor/ActionManager.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-09 09:39:01 +0800
committerchai <chaifix@163.com>2021-09-09 09:39:01 +0800
commit374b14af851415eb8055bb5251fb064c90f5f271 (patch)
tree20a564db3a37614c374ae5fe27285b166693bded /Assets/ActionTool/Editor/ActionManager.cs
parent7163529a1c092e766e26b7d7b7f7b4b71583962b (diff)
*vfx
Diffstat (limited to 'Assets/ActionTool/Editor/ActionManager.cs')
-rw-r--r--Assets/ActionTool/Editor/ActionManager.cs23
1 files changed, 22 insertions, 1 deletions
diff --git a/Assets/ActionTool/Editor/ActionManager.cs b/Assets/ActionTool/Editor/ActionManager.cs
index c6599cb7..f8eb327d 100644
--- a/Assets/ActionTool/Editor/ActionManager.cs
+++ b/Assets/ActionTool/Editor/ActionManager.cs
@@ -117,6 +117,8 @@ namespace ActionTool
private static GameObject s_RootActionTool;
private const string kRootActionTool = "RootActionTool";
+ private static AnimationEventBase copiedAnimationEvent;
+
public static int MaxEventsPerFrame // 所有帧里面事件最多有几个
{
get
@@ -478,7 +480,22 @@ namespace ActionTool
}
}
- public static void OnSelectAnimationEvent(AnimationEventBase animEvent)
+ public static void PasteEvent(object param)
+ {
+ if (copiedAnimationEvent == null)
+ return;
+ int frame = (int)param;
+ AnimationEventBase animEvent = UnityEngine.Object.Instantiate(copiedAnimationEvent);
+ if(animEvent != null)
+ {
+ animEvent.name = animEvent.type.ToString();
+ animEvent.startFrame = frame;
+ animationData.AddEvent(animEvent);
+ OnSelectAnimationEvent(animEvent);
+ }
+ }
+
+ public static void OnSelectAnimationEvent(AnimationEventBase animEvent)
{
m_CurAnimationEvent = animEvent;
if(animEvent != null)
@@ -499,5 +516,9 @@ namespace ActionTool
RootMotionEditor = EditorWindow.GetWindow<ActionRootMotionEditor>(true);
}
+ public static void CopyAnimationEvent(AnimationEventBase animEvent)
+ {
+ copiedAnimationEvent = UnityEngine.Object.Instantiate(animEvent);
+ }
}
} \ No newline at end of file