To use behaviors with Mecanim states, follow these steps:
- First we need to prepare the example scene. Create a Cube in the scene.
- Create two lights and name them Light1 and Light2. Place them near the cube so you can see their effect.
- Create an empty game object and name it Controller.
- Create a new Animator Controller and name it LogicController.
- Add an Animator component to the Controller game object and assign the LogicController to it.
- Open the LogicController.
- Create an empty state and name it NoBehaviors. Make it the default state.
- Create a Trigger parameter and name it Switch.
- Create four empty states and name them Light1Random, WaitAndSwitch, Light2Random, and RotateObject.
- Create the following listed transitions. ...