예제 #1
0
    public void LoadMap()
    {
        LocalStageData stage = Resources.Load <LocalStageData>("Data/Stage21");

        InitializeMaps(stage);

        RefreshBlocks();

        SetStageMapData(stage);

        MaxMoveCount = stage.MaxMoveCount;
    }
예제 #2
0
    private void InitializeMaps(LocalStageData stage)
    {
        showLine = stage.StageLengthY;
        maps     = new Block[(stage.StageLengthY * stage.StageLengthX), stage.StageLengthX];

        for (int y = 0; y < maps.GetLength(0); ++y)
        {
            for (int x = 0; x < maps.GetLength(1); ++x)
            {
                maps[y, x] = new Block(y, x);
            }
        }
    }
예제 #3
0
    private void SetStageMapData(LocalStageData stage)
    {
        for (int i = 0; i < stage.Datas.Length; ++i)
        {
            int y = stage.Datas[i].Location.y;
            int x = stage.Datas[i].Location.x;

            maps[y, x].SetFixedBlock(stage.Datas[i].IsFixedBlock);
            maps[y, x].SetShowFlag(stage.Datas[i].IsShow);
            maps[y, x].SetBlockType(stage.Datas[i].BlockType);
            maps[y, x].SetItemType(ItemType.None);
            maps[y, x].SetQuestBlockFlag(stage.Datas[i].IsQuestBlock);
            maps[y, x].SetQuestCount(stage.Datas[i].QuestCount);
        }
    }