Пример #1
0
 public override void Init(GameObject owner)
 {
     base.Init(owner);
     animator = owner.GetComponentInChildren <Animator>();
     attack   = owner.GetComponentInChildren <Attack>();
     mp       = owner.GetComponent <MimicPot>();
 }
Пример #2
0
 public override void Init(GameObject owner)
 {
     base.Init(owner);
     //player = GameObject.FindGameObjectWithTag("Player");
     mimicPot = owner.GetComponent <MimicPot>();
     player   = Player.Instance;
     hp       = owner.GetComponent <Health>();
 }
Пример #3
0
    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);
    }