// 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) { Spawned = false; sounds = animator.GetComponent <wolfAudio>(); animator.SetBool("vulnerable", true); pos = new Vector3(animator.gameObject.transform.position.x, animator.gameObject.transform.position.y + 0.5f, animator.gameObject.transform.position.z + 1); sounds.attacking(); }
// 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) { animator.SetBool("vulnerable", true); sounds = animator.GetComponent <wolfAudio>(); X = 0; Y = 0; CurrentPos = animator.GetComponent <GridMovement>(); targetPos = GameObject.FindGameObjectWithTag("Player").GetComponent <GridMovement>(); X = CurrentPos.Xpos; Y = CurrentPos.Ypos; move = false; Spawned = false; moveTick = 0; sounds.attacking(); }