The Animator Override controller is a type of asset which allows a extend existing controller, Animator The specific animations used but otherwise retaining the original ' s structure, parameters and logic.
An animated overlay is a class of asset that allows you to expand an existing animation controller, using a specific animations but preserving the original structure, parameters, and logic;
This allows-to-create multiple variants of the same basic state machine, if with each using different sets of Animati Ons.
This allows you to create multiple variants of the same basic state machine, which use different animations
For example, your game could have a variety of NPCs types living in the world, but each type (Goblin, Ogre, Elf, etc) has the IR own unique animations for walking, idling, sitting, etc.
For example: You have a series of NPCs live in the game, they have their own unique walk, idle, waiting for animations;
By creating one ' base ' Animator Controller containing the logic for all NPCs types, you could then create a override for E Ach type and drop in their respective animation files.
To demonstrate, here's a typical Animator Controller asset:
Create a base animation controller that contains the logic of all kinds of NPCs, and you can create an override for each NPC and then fill it with their respective animation;
usingUnityengine;usingSystem.Collections; Public classAnimatoroverideperformance:monobehaviour { Public BOOLM_test =true; Animator M_animator=NULL; Animatoroverridecontroller M_old=NULL; Animatoroverridecontroller m_new=NULL; //Use this for initialization voidStart () {M_animator= getcomponent<animator>(); M_old=NewAnimatoroverridecontroller (); M_new= Resources.load<animatoroverridecontroller> ("packages/artworks/player/m2/m2_p04/m2_p04"); Debug.logerror (m_new); M_old=(Animatoroverridecontroller) M_animator.runtimeanimatorcontroller; if(NULL!=m_new) {Debug.logerror (m_old["p01attack01"]); Debug.logerror (m_old["p01attack02"]); m_old["p01attack01"] = m_new["p04attack01"]; m_old["p01attack02"] = m_new["p04attack02"]; Debug.logerror (m_old["p01attack01"]); Debug.logerror (m_old["p01attack02"]); } } voidUpdate () {profiler.beginsample ("Update"); if(M_test &&m_new) {Profiler.beginsample ("this[]"); m_old["p01attack01"] = m_new["p04attack01"]; m_old["p01attack02"] = m_new["p04attack02"]; Profiler.endsample (); } profiler.endsample (); } }
One-time consumption of about 0.5 to 1ms
Animator Override Controllers Learning and performance testing