How would I add animation clips to animator controller via code in the editor? Please note I Do not need to do this at runtime. I’m trying to automate this task so I don’t have to do it over 100 times.
Looks like I solved it this round:
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections;
using System.Collections.Generic;
//MOST IMPORTANTLY USE
using UnityEditor.Animations;
public class Test : MonoBehaviour
{
#if UNITY_EDITOR
public AnimatorController animationController;
public AnimationClip animationClip;
[ContextMenu("Run Test")]
public void Run()
{
Motion motion = (Motion)animationClip as Motion;
animationController.AddMotion(motion);
}
#endif
}