コード例 #1
0
ファイル: ObjectTileManager.cs プロジェクト: realtics/team4
 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);
 }
コード例 #2
0
ファイル: ObjectTileManager.cs プロジェクト: realtics/team4
        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);
        }
コード例 #3
0
ファイル: ObjectTileManager.cs プロジェクト: realtics/team4
        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);
            }
        }