void OnTriggerStay2D(Collider2D other) { if (other.tag == "Player") { zombieAi = transform.parent.GetComponent <ZombieAi>(); zombieAi.Movement(); } }
// Use this for initialization void Start() { sR.sprite = null; maxBul = 50; Melee = true; ChangeGun(6); firepoint2 = transform.FindChild("FirePoint2"); firePoint = transform.FindChild("FirePoint"); zombie = GameObject.FindGameObjectWithTag("Zombie").GetComponent <ZombieAi>(); showGun = false; MaximumBul(maxBul); }
// 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) { ZombieAi zombieAi = animator.gameObject.GetComponent <ZombieAi>(); zombieAi.SetNextPoint(); }
// 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) { ZombieAi zombieAi = animator.gameObject.GetComponent <ZombieAi>(); zombieAi.ToggleWaiting(); }