コード例 #1
0
    public void CreateMap(Map map)
    {
        nowMapMessage.Clear();
        nowMap = map;
        for (short i = 0; i < map.mapXCount; i++)
        {
            for (short j = 0; j < map.mapYCount; j++)
            {
                MapNode node = new MapNode();
                node.xPoint = i;
                node.yPoint = j;
                MapPointMessage temp = new MapPointMessage();
                temp.xPoint    = i;
                temp.yPoint    = j;
                temp.xposition = (i - map.mapXCount / 2) * 10;
                temp.yposition = (j - map.mapYCount / 2) * 10;
                int index = i * map.mapYCount + j;
                if (index >= map.mapData.Count)
                {
                    temp.textureID = 0;
                }
                else
                {
                    temp.textureID = map.mapData[index];
                }

                nowMapMessage.Add(node, temp);
            }
        }
        SceneAction.OnUpDateMap();
    }