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()); }
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()); }