public override void Update(LittleBossAgent agent)
 {
     if (agent.GetDistanceBtwPlayerAndReturn() < agent.GetRange())
     {
         Debug.Log("Player is in reach");
         agent.SetState(LittleBossFollowPlayerState.GetInstance());
     }
 }
Пример #2
0
    public override void Update(LittleBossAgent agent)
    {
        agent.SetPlayerAsDestination();
        if (agent.GetDistanceBtwPlayerAndReturn() > agent.GetRange())
        {
            agent.SetState(LittleBossReturnState.GetInstance());
        }
        else if (Vector3.Distance(agent.transform.position, agent.GetDestination()) > agent.GetAttackRange())
        {
            agent.SetState(LittleBossFollowPlayerState.GetInstance());
        }
        else if (agent.GetCurrentTimeBtwAttacks() < 0)
        {
            agent.SetState(GetInstance());
        }
        else
        {
            agent.UpdateAttackTime();
        }

        //insert EXPLOSION!!
    }