Ejemplo n.º 1
0
    void Update()
    {
        if (!_featureToggles.farmsSpawn)
        {
            return;
        }

        if (!_placedFirstFarm && Random.value < .01f)
        {
            var houses = _worldPlane.GetBlocksWithHousesNotNearWater().ToList();

            if (houses.Count > 0)
            {
                SpawnMasterFarm(houses);
            }
            else
            {
                var bigHouses = _worldPlane.GetBlocksWithHouses()
                                .Where(block => block.GetOccupantHouse().IsInnerCityHouse())
                                .ToList();
                if (bigHouses.Count > 0)
                {
                    SpawnMasterFarm(bigHouses);
                }
            }
        }
    }