public virtual bool ConfigureTargetEntity() { if (this.entityTarget != null) { return(true); } this.NearbyEntities.Clear(); if (this.entityAliveSDX == null) { if (this.theEntity is EntityAliveSDX) { this.entityAliveSDX = (this.theEntity as EntityAliveSDX); } else { DisplayLog(" Not an EntityAliveSDX"); return(false); } } DisplayLog(" ConfigureTargetEntity()"); // Search in the bounds are to try to find the most appealing entity to follow. Bounds bb = new Bounds(this.theEntity.position, new Vector3(30f, 20f, 30f)); this.theEntity.world.GetEntitiesInBounds(typeof(EntityAlive), bb, this.NearbyEntities); for (int i = this.NearbyEntities.Count - 1; i >= 0; i--) { EntityAlive x = (EntityAlive)this.NearbyEntities[i]; if (x != this.theEntity) { // Check the entity against the incentives if (entityAliveSDX.CheckIncentive(this.lstIncentives, x)) { DisplayLog(" Found my Target: " + x.EntityName); this.entityTarget = x; return(true); } } } this.entityTarget = null; return(false); }