public void SetGrass(FactoryProvider provider, Vector3 relPosition, Island island, System.Random rand) { var grass = GetBasicResource(provider, relPosition, island, rand); grass.IslandElementViewSettings = new IslandElementViewSettings() { GetGameObject = () => viewFac.GetGrassVisualization(rand.Next()) }; grass.CircleElementProperties = new CircleElementProperties(0.5f, 0.5f); grass.HarvestController.harvestTactic = new SimpleHarvestedControllerTactic(grass, InventoryType: inventoryDatabase.Grass); var resourceCount = new Dictionary <InventoryType, int>(); resourceCount[inventoryDatabase.Grass] = 1; grass.HarvestInfo = new HarvestInfo(false, false, resourceCount, resourceCount, false, false, true, false); grass.Size = 1; }
public InventoryDatabase(UnityViewFactory viewFac) { Wood = new InventoryType("Wood", 10, false, "This is wood", () => viewFac.GetWoodVisualization()); Stone = new InventoryType("Stone", 10, false, "This is stone", () => viewFac.GetStoneVisualization()); BrownMushroom = new InventoryType("BrownMushroom", 10, false, "This is a brown mushroom", () => viewFac.GetBrownMushroomVisualization(0)); Grass = new InventoryType("Grass", 10, false, "This is a bunch o grass", () => viewFac.GetGrassVisualization(0)); }