Game
FNAF FORCES (Canned)
3 years ago

I found a new tool in Unity that will make finishing the animation events so much faster.


I found it here https://forum.unity.com/threads/animation-event-copier.140158/

I had to modify it slightly, so here's what I'm using if you want it.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEditor;

using System.Reflection;

public class AnimationEventCopier : EditorWindow

{

private AnimationClip sourceObject;

private AnimationClip targetObject;

[MenuItem("Window/Animation Event Copier")]

static void Init()

{

GetWindow(typeof(AnimationEventCopier));

}

void OnGUI()

{

EditorGUILayout.BeginHorizontal();

sourceObject = EditorGUILayout.ObjectField("Source", sourceObject, typeof(AnimationClip), true) as AnimationClip;

EditorGUILayout.EndHorizontal();

EditorGUILayout.BeginHorizontal();

targetObject = EditorGUILayout.ObjectField("Target", targetObject, typeof(AnimationClip), true) as AnimationClip;

EditorGUILayout.EndHorizontal();

if (sourceObject != null && targetObject != null)

{

EditorGUILayout.BeginHorizontal();

if (GUILayout.Button("Copy"))

CopyData();

EditorGUILayout.EndHorizontal();

}

}

void CopyData()

{

Undo.RegisterUndo(targetObject, "Undo Generic Copy");

AnimationClip sourceAnimClip = sourceObject as AnimationClip;

AnimationClip targetAnimClip = targetObject as AnimationClip;

if (sourceAnimClip && targetAnimClip)

{

//.SetAnimationEvents(targetAnimClip, null);

AnimationUtility.SetAnimationEvents(targetAnimClip, AnimationUtility.GetAnimationEvents(sourceAnimClip));

}

}

}

A problem with this tool.

It works well, but the project wont build when you have the script in it.

Just take it out while it's building, then you can put it back in with no problems.



1 comment

Loading...

Next up

Nightmare Camera

(the camera from Bondee's, but nightmare)

Happy 1 year YouTube anniversary @GL1TCHF0XY-GL1TCHTRAP

Foxy and the boys on their way.

A small update on F.N.A.F. F.O.R.C.E.S.

See you all at @FangameDirect ;)

ANNOUNCING THE REP'S X F.N.A.F. F.O.R.C.E.S. COLLABORATION!!!

Me, Doggo and a few other Fangame Direct creators are having a fire side at 3:50 EST.

Be there or be kneecapless.

The F.N.A.F. F.O.R.C.E.S. trailer is out! {Read Article}