public override float Utility(HT a) { // By declaring these classes INSIDE of JBAgent_Utility, they gain access to JBAgent_Utility.MEM if (MEM[PickUp.eType.none].Count == 0) { // Everything has been discovered!!! // If all SpawnPoints are known, set dest to the origin and return minimum utility uRec.dest = Vector3.zero; uRec.u = 0; return(uRec.u); } // Looks like we still have some exploring to do! // Return the closest unknown SpawnPoint and try to explore it. uRec.dest = a.ClosestSPFromList(MEM[PickUp.eType.none]).pos; uRec.u = 1; // The last line of ALL of these needs to be return base.Utility(a) // because base.Utility(a) applies both the curve and the utilMinMax limits return(base.Utility(a)); }