Ejemplo n.º 1
0
    public bool IsAgentInRange(GOAPAction nextAction)
    {
        if (nextAction.IsActionInterrupted(gameObject))
        {
            isActionInterrupted = true;
        }

        float dist = Vector3.Distance(transform.position, nextAction.target.transform.position);

        if (dist < nextAction.interactRange)
        {
            nextAction.setInRange(true);
            return(true);
        }
        else
        {
            return(false);
        }
    }