// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ClipUtils clipUtils = animator.gameObject.GetComponent <ClipUtils>(); clipUtils.StartFadeOutSweat(); clipUtils.SetMonsterMode(false); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ClipUtils clipUtils = animator.gameObject.GetComponent <ClipUtils>(); clipUtils.SetMonsterMode(false); GameObject crowd = GameObject.Find("Crowd"); CrowdSimulator cs = crowd.GetComponent <CrowdSimulator>(); cs.enabled = true; GameObject tableSet = GameObject.Find("TableSetMain"); Rigidbody rb = tableSet.AddComponent <Rigidbody>(); rb.AddForce(new Vector3(-4.0f, 5.0f, 0.0f), ForceMode.Impulse); clipUtils.StartMoveTable(rb); GameObject player = GameObject.Find("Player"); Vector3 pos = player.transform.position; pos.y = 1.077f; clipUtils.StartMovePlayerTowards(player, pos); }