public override void Init(GameObject owner) { base.Init(owner); animator = owner.GetComponentInChildren <Animator>(); attack = owner.GetComponentInChildren <Attack>(); mp = owner.GetComponent <MimicPot>(); }
public override void Init(GameObject owner) { base.Init(owner); //player = GameObject.FindGameObjectWithTag("Player"); mimicPot = owner.GetComponent <MimicPot>(); player = Player.Instance; hp = owner.GetComponent <Health>(); }
public override string Update() { float distance = Vector3.Distance(owner.transform.position, player.transform.position); MimicPot mp = owner.GetComponent <MimicPot>(); if (distance > mp.chaseRadius) { return("Mimic_Idle"); } if (distance < mp.attackRadius) { return("PUSH.Mimic_Attack"); } if (agent.isActiveAndEnabled && !mp.stunned) { agent.SetDestination(player.transform.position); } return(null); }