public override bool checkProceduralPrecondition(GameObject agent) { if (wells == null) { wells = FindObjectsOfType(typeof(WellComponent)) as WellComponent[]; } if (orderedWells == null) { orderedWells = wells.OrderBy(t => Vector3.Distance(transform.position, t.transform.position)); } foreach (WellComponent well in orderedWells) { if (well.engaged == false) { closest = well; break; } } if (closest != null) { target = closest.gameObject; } return(closest != null); }
public override void reset() { drunk = false; closest = null; startTime = 0; }