// :BUG: triggering animation from coroutine does not seem to work. Use booleans? IEnumerator AnimationChanger(BabyModel.ConcreteAction target_action) { while (true) { //Debug.Log("POSE: " + m_CowModel.m_CurrentBasePose.ToString()); //if (m_CowModel.m_CurrentBasePose == CowModel.CurrentBasePose.STANDING) // mAnimator.SetTrigger("STANDING"); //else // mAnimator.SetTrigger("LYING"); yield return(new WaitForSeconds(1)); break; } // Debug.Log("ANIM: " + target_action.ToString()); m_Animator.SetTrigger(target_action.ToString()); }
/// <summary> /// /// </summary> /// <param name="act">animation name</param> /// <param name="val">multipurpose parameter</param> void HandleCustomEvent(BabyModel.ConcreteAction act, float val) { m_Animator.SetTrigger(act.ToString()); // StartCoroutine(AnimationChanger(act)); }