private void InitWalkToPOI(AttractionZone poi) { _agentWalking.SetDestination(poi.GetRandomPositionInsideSatisfactionCircle()); _lockedInterest = poi.InterestCategory; SetLockedInterestValue(GetCurrentInterest(_lockedInterest) + PersistencyBonus); _lockedInterestTime = Time.time; }
private void InitWalkToPOI(AttractionZone poi) { _agentWalking.SetDestination(poi.transform.position); _lockedInterest = poi.InterestCategory; SetLockedInterestValue(GetCurrentInterest(_lockedInterest) + PersistencyBonus); _lockedInterestTime = Time.time; }
private AttractionZone ChoosePointOfInterest() { AttractionZone choosenPOI = null; var maxFoundAttraction = 0f; foreach (KeyValuePair <InterestCategory, float> interest in CurrentInterests) { var mostVisiblePOI = GetMostVisiblePointOfInterest(interest.Key); var foundPOI = mostVisiblePOI != null; var attraction = foundPOI ? GetCurrentInterest(interest.Key) : 0f; if (attraction > maxFoundAttraction) { choosenPOI = mostVisiblePOI; maxFoundAttraction = attraction; } } return(choosenPOI); }
public AttractionZone GetMostVisiblePointOfInterest(InterestCategory interestCategory) { AttractionZone mostVisiblePointOfInterest = null; var maxFoundVisibility = 0f; if (!_simulation.AttractionZones.ContainsKey(interestCategory)) { return(null); } foreach (var poi in _simulation.AttractionZones[interestCategory]) { var poiVisibility = poi.GetVisibilityAt(this.transform.position); if (poiVisibility > maxFoundVisibility) { mostVisiblePointOfInterest = poi; maxFoundVisibility = poiVisibility; } } return(mostVisiblePointOfInterest); }