Ejemplo n.º 1
0
    public override StatesAI NextState()
    {
        if (this.parent.GetHealth() <= 0)
        {
            return(StatesAI.Die);
        }

        StatesAI perceptionState = this.Perceptions();

        if (perceptionState != StatesAI.Invalid)
        {
            return(perceptionState);
        }

        return(base.NextState());
    }
Ejemplo n.º 2
0
    public override StatesAI NextState()
    {
        if (this.parent.GetHealth() <= 0)
        {
            return(StatesAI.Die);
        }

        StatesAI perceptionState = this.Perceptions();

        if (perceptionState != StatesAI.Invalid)
        {
            return(perceptionState);
        }

        if (Vector3.Distance(this.parent.transform.position, this.path[this.currWaypoint].transform.position) < this.pathProximityTolerance)
        {
            this.SetCurrWaypoint(this.currWaypoint + 1);
            return(StatesAI.Idle);
        }

        return(base.NextState());
    }