Ejemplo n.º 1
0
    public static void SaveData(MapSaveData mapData, string fileName)
    {
        mapData.SaveDataCheck();
        string json = JsonUtility.ToJson(mapData);

        SaveFile(fileName, json);
    }
Ejemplo n.º 2
0
    void OnSaveDataClicked(string fileName)
    {
        MapSaveData saveData = new MapSaveData();

        if (mHasStartCo)
        {
            saveData.startCo      = new MapSaveCoord();
            saveData.startCo.xPos = mStartCo.xPos;
            saveData.startCo.yPos = mStartCo.yPos;
        }
        if (mHasEndCo)
        {
            saveData.endCo      = new MapSaveCoord();
            saveData.endCo.xPos = mEndCo.xPos;
            saveData.endCo.yPos = mEndCo.yPos;
        }
        List <Coord> blockList = MapManager.Instant.GetBlockList();

        for (int i = 0; i < blockList.Count; ++i)
        {
            MapSaveCoord saveCo = new MapSaveCoord();
            saveCo.xPos = blockList [i].xPos;
            saveCo.yPos = blockList [i].yPos;
            saveData.blockList.Add(saveCo);
        }
        MapDataBase.SaveData(saveData, fileName);
    }
Ejemplo n.º 3
0
    public static bool Open(int instanceID, int line)
    {
        if (true == Application.isPlaying && true == Map.Instance.editMode)
        {
            string      name = EditorUtility.InstanceIDToObject(instanceID).name;
            MapSaveData data = Resources.Load <MapSaveData>(name);
            if (null == data)
            {
                return(false);
            }
            Editor.Instance.Init();
            Map.Instance.Init(data);
            Editor.Instance.stage          = data.stage;
            Editor.Instance.level          = data.level;
            Editor.Instance.width          = data.width;
            Editor.Instance.height         = data.height;
            Editor.Instance.blockSlotScale = data.blockSlotScale;
            Editor.Instance.blockSlotScale = Map.Instance.blockSlotScale;
            for (int i = 0; i < Map.Instance.blocks.childCount; i++)
            {
                MapBlock block = Map.Instance.blocks.GetChild(i).GetComponent <MapBlock>();
                Editor.Instance.blocks.Add(block.id, block);
                Editor.Instance.blockID = Mathf.Max(Editor.Instance.blockID, block.id + 1);
            }

            Debug.Log("success to load map file from " + "\'Assets/Resources/" + data.stage + "_" + data.level + ".asset" + "\'");
            return(true);
        }
        return(false);
    }
Ejemplo n.º 4
0
    void OnLoadDataClicked(string fileName)
    {
        ClearData();
        MapSaveData saveData = MapDataBase.LoadData(fileName);

        if (saveData == null)
        {
            return;
        }
        MapManager.Instant.ClearData();
        for (int i = 0; i < saveData.blockList.Count; ++i)
        {
            MapSaveCoord saveCo = saveData.blockList [i];
            MapManager.Instant.SetBlock(new Coord(saveCo.xPos, saveCo.yPos), false);
        }
        if (saveData.startCo != null)
        {
            OnClickGird(new Coord(saveData.startCo.xPos, saveData.startCo.yPos), MapView.GridType.StartPoint);
        }
        if (saveData.endCo != null)
        {
            OnClickGird(new Coord(saveData.endCo.xPos, saveData.endCo.yPos), MapView.GridType.EndPoint);
        }
        view.RefreshBlock();
    }
Ejemplo n.º 5
0
    public static MapSaveData LoadData(string fileName)
    {
        string content = LoadFile(fileName);

        if (string.IsNullOrEmpty(content))
        {
            return(null);
        }
        MapSaveData saveData = JsonUtility.FromJson <MapSaveData> (content);

        saveData.LoadDataCheck();
        return(saveData);
    }
Ejemplo n.º 6
0
    // 保存地图
    public void SaveMapBlockData(string path)
    {
        MapSaveData map_save_data = new MapSaveData();

        map_save_data.map_width  = map_width;
        map_save_data.map_height = map_height;
        map_save_data.map_step   = map_step;
        map_save_data.grid_array = _grid_array;

        using (FileStream stream = File.Open(path, FileMode.Create))
        {
            var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            binaryFormatter.Serialize(stream, map_save_data);
        }
    }
Ejemplo n.º 7
0
    public void LoadMap(string path)
    {
        // 地址先写死
        if (!File.Exists(path))
        {
            Debug.LogError("地图数据不存在:" + path);
            return;
        }

        using (FileStream stream = File.OpenRead(path))
        {
            map_data = new MapSaveData();
            var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            map_data = (MapSaveData)binaryFormatter.Deserialize(stream);
        }
    }
Ejemplo n.º 8
0
 /// <summary>
 /// id,name,star,point,isfinish,isshow,islocked,data
 /// string.Format("{0},{1},{2},{3},{4}",ID,IsFinish?1:0,MapName,MapStar,MapData); 
 /// </summary>
 /// <param name="mapdata"></param>
 /// <returns></returns>
 public static  MapSaveData Parse(string mapdata)
 {
     var lst = mapdata.Split(',');
     var map = new MapSaveData();
     var index = 0;
     if (lst.Length <= 6) return null;
     map.ID = int.Parse(lst[index++]);
     map.MapName = lst[index++];
     map.MapStar = int.Parse(lst[index++]);
     map.MapPoint = int.Parse(lst[index++]);
     map.IsFinish = lst[index++] == "1";
     map.IsShow = lst[index++] == "1";
     map.IsLocked = lst[index++] == "1";
     map.MapData = lst[index];
     return map;
 }
Ejemplo n.º 9
0
    public void SaveMap(InputField input)
    {
        string      mapName     = input.text;
        string      localPath   = "Assets/Resources/Stages/stage" + mapName + ".json";
        MapSaveData mapSaveData = SerializeMap();

        if (mapSaveData != null)
        {
            if (File.Exists(localPath))
            {
                Debug.Log("File Exists");
                File.Delete(localPath);
            }

            File.WriteAllText(localPath, JsonConvert.SerializeObject(mapSaveData));
            PrintDebugText("Map saved at " + localPath);
        }
    }
Ejemplo n.º 10
0
    // update with battle result
    public static bool UpdateDecksInFile(CardTypeCount[] attaker, CardTypeCount[] defender)
    {
        string path = Application.persistentDataPath + "/" + GameSettings.INSTANCE.campaign_battle_name;

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);

            MapSaveData data = formatter.Deserialize(stream) as MapSaveData;

            Assert.IsTrue(GameSettings.INSTANCE.IsBattle());
            data.UpdateBattleDecks(attaker, defender);
            formatter.Serialize(stream, data);
            return(true);
        }

        return(false);
    }
Ejemplo n.º 11
0
    public void SaveFile()
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/" + SceneManager.GetActiveScene().name;
        FileStream      stream    = new FileStream(path, FileMode.Create);

        if (nodes == null)
        {
            nodes = FindObjectsOfType <MapNode>();
            System.Comparison <MapNode> comp = (a, b) => a.name.CompareTo(b.name);
            System.Array.Sort(nodes, comp);
            for (int i = 0; i < nodes.Length; ++i)
            {
                nodes[i].node_idx = i;
            }
        }
        int attaker_idx  = -1;
        int defender_idx = -1;

        if (target_node != null && selected_node != null)
        {
            for (int i = 0; i < nodes.Length; ++i)
            {
                if (nodes[i] == selected_node)
                {
                    defender_idx = i;
                }
                if (nodes[i] == target_node)
                {
                    attaker_idx = i;
                }
            }
        }

        MapSaveData data = new MapSaveData(nodes, attaker_idx, defender_idx);

        formatter.Serialize(stream, data);
        stream.Close();

        saved_campaign = true;
    }
Ejemplo n.º 12
0
    public MapSaveData GetSaveData()
    {
        MapSaveData saveData = ScriptableObject.CreateInstance <MapSaveData> ();

        saveData.stage          = stage;
        saveData.level          = level;
        saveData.width          = width;
        saveData.height         = height;
        saveData.blockSlotScale = blockSlotScale;
        saveData.tiles          = new int[mapTiles.Length];
        saveData.blocks         = new BlockSaveData[blocks.childCount];
        for (int i = 0; i < blocks.childCount; i++)
        {
            saveData.blocks [i] = blocks.GetChild(i).GetComponent <MapBlock>().GetSaveData();
        }
        for (int i = 0; i < mapTiles.Length; i++)
        {
            saveData.tiles[i] = mapTiles[i].id;
        }
        return(saveData);
    }
Ejemplo n.º 13
0
 public void InstantiateMap(MapSaveData loadedMapData)
 {
     for (int i = 0; i < loadedMapData.clears.Count; i++)
     {
         AddClearCondition((int)loadedMapData.clears[i].type, loadedMapData.clears[i].goal);
     }
     for (int i = 1; i < loadedMapData.objects.Count; i++)
     {
         ObjectData temp = loadedMapData.objects[i];
         ChangeTileMode((int)temp.tag);
         Vector3    tilePos = new Vector3(temp.xPos, 0, temp.yPos);
         GameObject newTile;
         if (temp.tag == TileMode.Floor || temp.tag == TileMode.GoalFloor)
         {
             newTile = Instantiate(currentTile, tilePos, Quaternion.identity, floors);
         }
         else if (temp.tag == TileMode.NormalWall || temp.tag == TileMode.Mirror || temp.tag == TileMode.Glass)
         {
             newTile = Instantiate(currentTile, tilePos, Quaternion.Euler(0, temp.angle, 0), walls);
         }
         else if (temp.tag == TileMode.StartFloor)
         {
             newTile = Instantiate(currentTile, tilePos + new Vector3(0, 1, 0), Quaternion.identity, jacksons);
         }
         else
         {
             newTile = Instantiate(currentTile, tilePos + new Vector3(0, 1, 0), Quaternion.Euler(0, temp.angle, 0), objects);
         }
         newTile.GetComponent <MapEditorTile>().mapPos = new Vector2(tilePos.x, tilePos.z);
         newTile.GetComponent <BoxCollider>().enabled  = true;
     }
     for (int i = 0; i < loadedMapData.bullets.Count; i++)
     {
         AddBullet((int)loadedMapData.bullets[i]);
     }
     if (loadedMapData.comments != null)
     {
         AddComment(loadedMapData.comments);
     }
 }
Ejemplo n.º 14
0
    //미니 맵도 여기서 관리

    private void Start()
    {
        //유저 맵 데이터 기반으로 맵 불러오기
        m_BlockNode = ResourceLoader.CreatePrefab("Prefabs/Map/Block");
        m_BlockNode.transform.SetParent(transform, false);
        m_PlayerObject = GameObject.Find("GameObject").transform.GetChild(1).transform.GetChild(0).gameObject;
        //유저가 현재 선택한 맵 데이터 기반

        int         iStageIndex = GameManager.instance.StageIndex;
        MapSaveData Node        = JSON.JsonUtil.LoadJson <MapSaveData>("UserMapData");

        string Route = "Prefabs/Map/" + iStageIndex + "_StageMiniMap";

        m_MiniMap = ResourceLoader.CreatePrefab(Route);
        m_MiniMap.transform.SetParent(m_MiniMapUI.transform, false);
        //미니맵 셋팅

        MapSetting(iStageIndex);                          //맵 데이터 셋팅
        MapClassSetting(GameManager.instance.BlockIndex); //각각의 맵의 블럭 클래스를 각각 설정

        EndPoint(false);
    }
Ejemplo n.º 15
0
    // 加载地图
    public void LoadMapBlockData(string path)
    {
        if (!File.Exists(path))
        {
            return;
        }

        using (FileStream stream = File.Open(path, FileMode.Open))
        {
            MapSaveData map_save_data   = new MapSaveData();
            var         binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            map_save_data = (MapSaveData)binaryFormatter.Deserialize(stream);

            map_width   = map_save_data.map_width;
            map_height  = map_save_data.map_height;
            map_step    = map_save_data.map_step;
            _grid_array = map_save_data.grid_array;

            InitMeshComponent();
            UpdateMesh();
        }
    }
Ejemplo n.º 16
0
    public bool LoadFile()
    {
        string path = Application.persistentDataPath + "/" + SceneManager.GetActiveScene().name;

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);

            MapSaveData data = formatter.Deserialize(stream) as MapSaveData;

            // set saved data
            if (nodes.Length != data.nodes.Length)
            {
                stream.Close();
                return(false);
            }
            Assert.IsTrue(nodes.Length == data.nodes.Length);   // redundant

            // shorted at Awake
            //System.Comparison<MapNode> comp = (a, b) => a.name.CompareTo(b.name);
            //System.Array.Sort(nodes, comp);

            // set data from same index
            for (int i = 0; i < nodes.Length; ++i)
            {
                nodes[i].Set(data.nodes[i]);
            }

            stream.Close();

            return(true);
        }
        else
        {
            return(false);
        }
    }
Ejemplo n.º 17
0
    void CreateRoom(Transform parent, Vector2Int originPosition, int amount)
    {
        if (amount <= 0)
        {
            return;
        }

        LoadTilemap load = parent.gameObject.AddComponent <LoadTilemap>();
        MapSaveData data = RoomsData[Random.Range(0, RoomsData.Length)];

        parent.gameObject.name = data.name;
        load.MapData           = data;
        load.LoadData(originPosition);

        Vector2Int roomPosition = new Vector2Int(
            originPosition.x + data.TopRight.x,
            originPosition.y
            );

        for (int i = 0; i < amount; i++)
        {
            CreateRoom(parent, roomPosition, amount - 1);
        }
    }
Ejemplo n.º 18
0
    public MapSaveData SerializeMap()
    {
        if (jacksons.childCount == 0)
        {
            PrintDebugText("There is no start floor");
            return(null);
        }
        else
        {
            int minX = 0, minY = 0, maxX = 0, maxY = 0;
            for (int i = 0; i < floors.childCount; i++)
            {
                MapEditorTile temp = floors.GetChild(i).GetComponent <MapEditorTile>();
                if (temp.mapPos.x < minX)
                {
                    minX = (int)temp.mapPos.x;
                }
                if (temp.mapPos.y < minY)
                {
                    minY = (int)temp.mapPos.y;
                }
                if (temp.mapPos.x > maxX)
                {
                    maxX = (int)temp.mapPos.x;
                }
                if (temp.mapPos.y > maxY)
                {
                    maxY = (int)temp.mapPos.y;
                }
            }
            MapSaveData mapSaveData = new MapSaveData();
            mapSaveData.AddObject(TileMode.None, new Vector2((Mathf.Max(maxX - minX, maxY - minY) + 1) * 5, 0));

            for (int i = 0; i < walls.childCount; i++)
            {
                MapEditorTile temp = walls.GetChild(i).GetComponent <MapEditorTile>();
                mapSaveData.AddObject(temp.thisTile, temp.mapPos, (int)temp.transform.eulerAngles.y);
            }
            for (int i = 0; i < floors.childCount; i++)
            {
                MapEditorTile temp = floors.GetChild(i).GetComponent <MapEditorTile>();
                mapSaveData.AddObject(temp.thisTile, temp.mapPos);
            }
            for (int i = 0; i < jacksons.childCount; i++)
            {
                MapEditorTile temp = jacksons.GetChild(i).GetComponent <MapEditorTile>();
                mapSaveData.AddObject(TileMode.StartFloor, temp.mapPos);
            }
            for (int i = 0; i < objects.childCount; i++)
            {
                MapEditorTile temp = objects.GetChild(i).GetComponent <MapEditorTile>();
                mapSaveData.AddObject(temp.thisTile, temp.mapPos, (int)temp.transform.eulerAngles.y);
            }

            for (int i = 0; i < clearConditionButtons.Length; i++)
            {
                int goal = -1;
                if (i == (int)ClearType.AllCase || i == (int)ClearType.AllFloor || i == (int)ClearType.AllTurret)
                {
                    goal = clearConditionButtons[i].transform.Find("Toggle").GetComponent <Toggle>().isOn ? 0 : goal;
                }
                else
                {
                    goal = int.Parse(clearConditionButtons[i].transform.Find("InputField").GetComponent <InputField>().text);
                }
                if (goal != -1)
                {
                    mapSaveData.AddClears((ClearType)i, goal);
                }
            }
            for (int i = 0; i < bullets.childCount; i++)
            {
                mapSaveData.bullets.Add(bullets.GetChild(i).GetComponent <MapEditorTile>().bulletCode);
            }
            mapSaveData.comments = comment;
            return(mapSaveData);
        }
    }
Ejemplo n.º 19
0
    public void Init(int stage, int level)
    {
        MapSaveData mapSaveData = Resources.Load <MapSaveData> (stage + "_" + level);

        Init(mapSaveData);
    }
Ejemplo n.º 20
0
    public void OnClick()
    {
        string strValue = m_InputFiled.transform.GetChild(1).GetComponent <UIInput>().value;

        if (strValue.Length < 8 && strValue.Length > 1)
        {
            //8자리 미만이다.
            if (!JSON.JsonUtil.FileCheck("UserNameData")) //현재 파일이 있는가?
            {
                UserNameData Node = new UserNameData();
                Node.m_strUserName = strValue;
                string jsonData = JSON.JsonUtil.ToJson(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserNameData", jsonData);
            }

            if (!JSON.JsonUtil.FileCheck("UserData")) //현재 파일이 있는가?
            {
                //없으면 데이터 생성
                //메인 캐릭터 라벨
                CharData[] Node = new CharData[1];
                Node[0]          = new CharData();
                Node[0].m_Level  = 1;
                Node[0].m_iIndex = 0;
                Node[0].m_CurEXP = 0;
                Node[0].m_eClass = CLASS.CLASS_THIEF;

                string jsonData = JSON.JsonUtil.ToJson <CharData>(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserData", jsonData);
                //플레이어 캐릭터 JSON
            }

            if (!JSON.JsonUtil.FileCheck("UserPartyData"))
            {
                CharPartyList Node = new CharPartyList();
                Node.m_PartyListIndex    = new int[4];
                Node.m_PartyListIndex[0] = 0;
                Node.m_PartyListIndex[1] = -1;
                Node.m_PartyListIndex[2] = -1;
                Node.m_PartyListIndex[3] = -1;

                string jsonData = JSON.JsonUtil.ToJson(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserPartyData", jsonData);
                //플레이어 캐릭터 JSON
            }

            if (!JSON.JsonUtil.FileCheck("UserMapData"))    //유저 맵 데이터
            {
                MapSaveData[] Node = new MapSaveData[3];

                for (int i = 0; i < 3; i++)
                {
                    Node[i] = new MapSaveData();
                    Node[i].m_bStageClear = false;
                }
                //현재는 맵이 세가지

                string jsonData = JSON.JsonUtil.ToJson <MapSaveData>(Node);
                Debug.Log(jsonData);
                JSON.JsonUtil.CreateJson("UserMapData", jsonData);
            }

            UserInfo.instance.Init();
            UserInfo.instance.PartySetting();
            GameManager.instance.Init();

            //플레이어 캐릭터 정보가 존재한다면 로딩
            LoadScene.SceneLoad("LobbyScene");
            //게임 씬 로딩
        }
    }
Ejemplo n.º 21
0
    public void Init(MapSaveData info)
    {
        while (0 < tiles.childCount)
        {
            Transform tile = tiles.GetChild(0);
            tile.SetParent(null);
            DestroyImmediate(tile.gameObject);
        }

        while (0 < blocks.childCount)
        {
            Transform block = blocks.GetChild(0);
            block.SetParent(null);
            DestroyImmediate(block.gameObject);
        }

        while (0 < slots.childCount)
        {
            Transform slot = slots.GetChild(0);
            slot.SetParent(null);
            DestroyImmediate(slot.gameObject);
        }

        while (0 < hints.childCount)
        {
            Transform hint = hints.GetChild(0);
            hint.SetParent(null);
            DestroyImmediate(hint.gameObject);
        }

        if (null != _blinkHintBlock)
        {
            StopCoroutine(_blinkHintBlock);
            _blinkHintBlock = null;
        }
        activatedHintBlocks = new List <HintBlock> ();

        stage          = info.stage;
        level          = info.level;
        width          = info.width;
        height         = info.height;
        blockSlotScale = info.blockSlotScale;
        if (0 == width || 0 == height)
        {
            throw new System.Exception("zero size map");
        }

        mapTiles = new MapTile[width * height];
        for (int y = 0; y < height; y++)
        {
            for (int x = 0; x < width; x++)
            {
                MapTile mapTile = GameObject.Instantiate <MapTile> (mapTilePrefab);
                mapTile.name = "MapTile_" + x + "_" + y;
                mapTile.transform.SetParent(tiles, false);
                mapTile.transform.localPosition = new Vector3(x, height - y, 0.0f);
                mapTile.Init(info.tiles [x + y * width]);
                mapTiles [x + y * width] = mapTile;
            }
        }
        {
            Vector3 position = transform.position;
            position.x         = -(float)(width - 1) / 2;
            transform.position = position;
        }

        {
            Transform blockSlots = transform.Find("BlockSlots");
            Vector3   position   = blockSlots.position;
            position.x = 0.0f;
            blockSlots.transform.position = position;
        }

        mapBlocks = new List <MapBlock> ();
        if (null != info.blocks)
        {
            foreach (BlockSaveData blockSaveData in info.blocks)
            {
                MapBlock mapBlock = GameObject.Instantiate <MapBlock> (mapBlockPrefab);
                mapBlock.Init(blockSaveData);
                mapBlocks.Add(mapBlock);
            }
        }
    }
Ejemplo n.º 22
0
 private IEnumerator LoadMap(MapSaveData rawData)
 {
     yield return(null);
 }
Ejemplo n.º 23
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        if (false == Application.isPlaying)
        {
            return;
        }
        Editor editor = (Editor)target;

        if (GUILayout.Button("Init"))
        {
            MapSaveData mapSaveData = ScriptableObject.CreateInstance <MapSaveData>();
            mapSaveData.stage          = editor.stage;
            mapSaveData.level          = editor.level;
            mapSaveData.width          = editor.width;
            mapSaveData.height         = editor.height;
            mapSaveData.tiles          = new int[mapSaveData.width * mapSaveData.height];
            mapSaveData.blockSlotScale = 1.0f;
            Map.Instance.Init(mapSaveData);
        }

        if (GUILayout.Button("Save"))
        {
            Map.Instance.stage = editor.stage;
            Map.Instance.level = editor.level;

            MapSaveData saveData = Map.Instance.GetSaveData();
            AssetDatabase.CreateAsset(saveData, "Assets/Resources/" + saveData.stage + "_" + saveData.level + ".asset");
            for (int i = 0; i < saveData.blocks.Length; i++)
            {
                AssetDatabase.AddObjectToAsset(saveData.blocks[i], saveData);
            }
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();

            Debug.Log("success to save map file to " + "\'Assets/Resources/" + saveData.stage + "_" + saveData.level + ".asset" + "\'");
        }

        if (GUILayout.Button("Load"))
        {
            editor.Init();
            MapSaveData data = Resources.Load <MapSaveData>(editor.stage + "_" + editor.level);
            Map.Instance.Init(data);

            editor.blockSlotScale = Map.Instance.blockSlotScale;
            for (int i = 0; i < Map.Instance.blocks.childCount; i++)
            {
                MapBlock block = Map.Instance.blocks.GetChild(i).GetComponent <MapBlock>();
                editor.blocks.Add(block.id, block);
                editor.blockID = Mathf.Max(editor.blockID, block.id + 1);
            }
            Debug.Log("success to load map file from " + "\'Assets/Resources/" + data.stage + "_" + data.level + ".asset" + "\'");
        }

        if (GUILayout.Button("Check Map Validation"))
        {
            for (int stage = 1; stage <= 72; stage++)
            {
                for (int level = 1; level <= 24; level++)
                {
                    MapSaveData data = Resources.Load <MapSaveData> (stage + "_" + level);
                    if (null == data)
                    {
                        Debug.Log(stage + "-" + level + " is null");
                        return;
                    }
                    Map.Instance.Init(data);

                    int count = 0;
                    foreach (MapTile mapTile in Map.Instance.mapTiles)
                    {
                        if (0 != mapTile.id)
                        {
                            count++;
                        }
                    }
                    if (0 != count % 5)
                    {
                        Debug.Log(stage + "-" + level + " is wrong");
                    }
                }
            }
            Debug.Log("complete vaidation check");
        }
        Map.Instance.blockSlotScale = editor.blockSlotScale;

        for (int i = 0; i < Map.Instance.slots.childCount; i++)
        {
            SlotBlock block = Map.Instance.slots.GetChild(i).GetComponent <SlotBlock>();
            block.transform.localScale = new Vector3(Map.Instance.blockSlotScale, Map.Instance.blockSlotScale, 1.0f);
        }
    }