public override void UnitComplete(float quality) { if (!Active()) { return; } ConsumeCostItems(); var farmPlot = StructureId.GetStructure() as Farm; // change to new plant if (farmPlot.PlantName != Option.Name) { farmPlot.PlantName = Option.Name; farmPlot.ResetGrowth(); } else { if (farmPlot.IsMature()) { farmPlot.SpawnYield(); farmPlot.ResetGrowth(); } else { farmPlot.Quality += quality; } } }
internal Structure GetStructure() { if (_structure == null) { _structure = StructureId.GetStructure(); } return(_structure); }
public override void UnitComplete(float quality) { ConsumeCostItems(); var barrel = StructureId.GetStructure() as LiquidContainer; barrel.FillLevel = Mathf.Min(barrel.Capacity, barrel.FillLevel + 25); }