Esempio n. 1
0
 private void InitWalkToPOI(AttractionZone poi)
 {
     _agentWalking.SetDestination(poi.GetRandomPositionInsideSatisfactionCircle());
     _lockedInterest = poi.InterestCategory;
     SetLockedInterestValue(GetCurrentInterest(_lockedInterest) + PersistencyBonus);
     _lockedInterestTime = Time.time;
 }
Esempio n. 2
0
 private void InitWalkToPOI(AttractionZone poi)
 {
     _agentWalking.SetDestination(poi.transform.position);
     _lockedInterest = poi.InterestCategory;
     SetLockedInterestValue(GetCurrentInterest(_lockedInterest) + PersistencyBonus);
     _lockedInterestTime = Time.time;
 }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
    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);
    }