I have a bunch of characters, all of which have (separate) animations which have been placed in the project folder with the @AnimationName naming convention. I don’t need every animation in every scene, however, so I plan to load them in in dynamically as each scene finishes loading.
I’m struggling to find a way to load ONLY the clip though. I can load the model and pull the clip from it with something like:
AnimationClip animClip = (AnimationClip) ( (GameObject)Resources.Load("Animations/Anim1" )).animation[clipName].clip;
But I seem to be wasting time and memory* loading things I don’t need and merely discard again. Is there some way I can extract the clip from the prefab and only import that? If I have to use AssetBundles instead of Resources, that’s fine. I tried dragging the clip out of the prefab in the project navigator, but it doesn’t like it.
If it needs an Editor script to process the clips ahead of time, that’s fine too.
- by comparison to simply having public properties of AnimClip on a scene object and dragging only the AnimationClip onto it.