public PlantedCropData(CropData cropData, Vector2Int position, int age, bool dehydrated, bool dead) { this.cropData = cropData; this.position = position; this.age = age; this.dehydrated = dehydrated; this.dead = dead; }
public void PlantCrop(Vector2Int tile, CropData cropData) { if (plantedCrops.ContainsKey(tile)) { Debug.LogWarning($"Tile {tile} already has a crop!"); return; } PlantedCrop crop = Instantiate(plantedCropPrefab, tile + new Vector2(0.5f, 0.5f), Quaternion.identity); plantedCrops[tile] = crop; crop.SetCrop(cropData); }
public void SetCrop(CropData cropData) { this.cropData = cropData; UpdateSprite(); }