Пример #1
0
        public void LoadDecorationTiles(DecorationTile.SaveData[] datas)
        {
            if (datas == null)
            {
                return;
            }

            foreach (var item in datas)
            {
                GameObject     obj    = Instantiate(prefDecorationTile, objectTileGroup.transform);
                DecorationTile script = obj.GetComponent <DecorationTile>();
                script.SetSaveData(item);

                objectTileDic.Add(item.point, script);
            }
        }
Пример #2
0
        public void DeployDecoration(Point point, int type)
        {
            FarmUIManager.Instance.ClosePanel(FarmUIManager.ECategory.Decoration);

            if (CheckTileIsExist(point))
            {
                return;
            }

            GameObject     obj    = Instantiate(prefDecorationTile, objectTileGroup.transform);
            DecorationTile script = obj.GetComponent <DecorationTile>();

            script.DeployTile(point, type);

            objectTileDic.Add(point, script);
            MapData.Instance.WriteSaveData(MapData.ESaveType.Decoration);
        }