Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
            }
        }