Enterprise Apps: Education App Part 4

Simon Leen
2 min readNov 6, 2021

--

Objective: Set up Animation States for the Horse

For the Animations, we want to be able to transition from full horse to exposed muscle and exposed muscle to bone when the next button is pressed. We then want to reverse the transitions when the previous button is pressed. We will also have the ability to go and forward between states. As you can see in the image above we use an integer parameter which will be used to trigger the transition states, also shown above.

We set up a UIManager script and create a public Animator which is set in the inspector using the horse prefab(which has an animator component attached). We also create a public int for the animation states. Thes states will represent

0: Full Horse, 1: Muscle Exposed, 2: Bones Exposed

Next and Previous methods are created and triggered using OnClick events on the UI buttons.

Switch statements are used to transition and set anim states.

--

--

No responses yet