"EASY ANIMATOR CONTROLLER" proposes, in a first stage, an interface to rename the set of "AnimationClips" you want to use in your "GameObjects", so that the new names encode all the essential information that the system now recognizes and stores in data structures.
In a second stage, taking advantage of this information, automate the creation of an "AnimatorController" from scratch, with as many states as "AnimationClips" renamed in the first stage, sub state machines, transitions and appropriate parameters. In this second stage new data structures are also created to store all the essential information of these states, sub state machines, transitions and parameters making available to our scripts the necessary information to choose the animation we are looking for at any time through an "interface" composed of simple auxiliary methods.
All this automation is preset through parameters exposed in a single "scriptable object" (type "AnimationsSO"), greatly facilitating the saving of the configuration "assets" and avoiding, to a large extent, touching parts of "EASY ANIMATOR CONTROLLER" that may break its functionality.
It takes little time in the world of game development to realize that one of the "elephants in the room" is the animation of your GameObjects. The system provided by Unity is called "MECANIM" and everyone who has dealt with it, has either spent a lot of time to achieve a reasonable result, or has directly thrown in the towel.
"MECANIM" is complicated mainly for two reasons:
animator.PlayClip(string hopeThisNameExists)
animator.SetBool(string hopeThisNameExists)
animator.SetTrigger(string hopeThisNameExists)
animator.SetFloat(string hopeThisNameExists)
Starting with the second problem, it would be unfair to say that "MECANIM" forces me to base my animation system on the intensive use of "magic strings", a common practice, but not recommended in programming. And it would not be fair because there are alternatives, but the truth is that since no alternative is proposed to us, this is the way most developers work with "MECANIM".
Encode three levels of information into the name of the animation clips I want to use is the beginning of the solution to the aforementioned problem of the intensive use of "magic strings" at the heart of "MECANIM".
The potential of "MECANIM" after this paradigm shift is huge in aspects such as adaptability, maintainability, scalability, clarity, reliability and automation.
The information encoded in the new animation names includes three “Information Levels”:
These 3 info levels are enough to choose the right animation in complex animation systems like the example we explain in the documentation document provided.
After giving a solution to the second problem, we have laid the groundwork to solve the first problem that we defined as "requiring a lot of setup time in the editor to set states, distribute them in substate machines if needed, associate AnimationClips, create transitions, create parameters and link them to scripts. With all the information that our scripts now have, stored in data structures, we can create new "AnimatorControllers" from scratch in an automated way based on preset parameters in "AnimationsSO" type configuration "assets" so the amount of time consumed when creating "AnimatorControllers" from scratch is reduced to the time needed to press a button.
"MECANIM is the default system provided by Unity, it is true that it is in some aspects a kind of "black box" that makes it difficult to debug in situations of failure or unexpected result, but it is a functional "finite state machine" with a multitude of configurable parameters in the editor (safe trial and error) to achieve a very high level of detail in the calibration of the animations, very difficult to achieve by giving up the system.
"Unity Mecanim Animator Controller" has, in our opinion, more lights than shadows and therefore, we are not in favor of giving it up because, although the two main problems are really important and weigh down the system, they have a solution and once solved, the potential of the system is maximized to give a solid, scalable and fast response to the animation needs of developers.
https://www.jointhedotsmapgenerator.com/easy-animator-controller