- I want to add or remove animation clips in the animation controller at runtime.
You are trying to do one of the following:
- Set up a new animation clip at runtime using Mecanim.
- Change or Remove an animation clip during runtime.
It is not possible to add or remove clips at runtime with Mecanim, but you can override them with AnimatorOverrideController to dynamically change the animation clips.
Please see this article here which describes how the AnimatorOverrideController is used to override clips from a controller to change the dynamics of animations.
In Unity 5.2 there is a new Playable API that will allow you to play clips on Animator components without a controller.
This article applies to Unity version 5.1.1f1