// 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) { // rend = animator.gameObject.GetComponent<Renderer>(); collider = animator.gameObject.GetComponent <BoxCollider>(); count = 0; collider.enabled = false; sounds = animator.GetComponent <wolfAudio>(); sounds.dying(); }
// 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(); }
// 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("attack", false); animator.SetBool("shooting", false); animator.SetBool("vulnerable", false); animator.SetInteger("AttackChoice", 0); //rend = animator.gameObject.GetComponent<Renderer>(); collider = animator.gameObject.GetComponent <BoxCollider>(); count = 0; if (animator.CompareTag("Player")) { combatLogic.attacklock = true; } sounds = animator.GetComponent <wolfAudio>(); sounds.damaged(); }