Example #1
0
    private void Start()
    {
        _monster = GetComponent <Monster>();
        _audio   = GetComponent <MonsterAudio>();

        Assert.IsNotNull(_monster);
        Assert.IsNotNull(_audio);
        Assert.IsNotNull(_munchFX);

        StartCoroutine(Eat());
    }
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     audio = animator.GetComponentInParent <MonsterAudio>();
     audio.Footsteps.Play();
 }