public void UpdateHarvestTimeByLandChange(Point point, string landType) { if (objectTileDic.ContainsKey(point)) { if (objectTileDic[point].TileType == ObjectTile.ETileType.Product) { ProductTile script = objectTileDic[point] as ProductTile; script.UpdateLandType(landType); } } MapData.Instance.WriteSaveData(MapData.ESaveType.Product); }
public void PlantProduct(Point point, int type) { FarmUIManager.Instance.ClosePanel(FarmUIManager.ECategory.Plant); if (CheckTileIsExist(point)) { return; } GameObject obj = Instantiate(prefProductTile, objectTileGroup.transform); ProductTile script = obj.GetComponent <ProductTile>(); string landType = LandTileManager.Instance.GetLandTileAtPoint(point).Type; script.PlantProduct(point, type, landType); objectTileDic.Add(point, script); MapData.Instance.WriteSaveData(MapData.ESaveType.Product); }
public void LoadProductTiles(ProductTile.SaveData[] datas) { if (datas == null) { return; } foreach (var item in datas) { if (objectTileDic.ContainsKey(item.point)) { continue; } GameObject obj = Instantiate(prefProductTile, objectTileGroup.transform); ProductTile script = obj.GetComponent <ProductTile>(); string landType = LandTileManager.Instance.GetLandTileAtPoint(item.point).Type; script.SetSaveData(item, landType); objectTileDic.Add(item.point, script); } }