示例#1
0
    public static void LoadMap()
    {
        string path = EditorUtility.OpenFilePanel("", "", "xml");

        if (path != null || path != "")
        {
            hasMap = false;
            Map map = MapSerializer.Load(path);

            if (map != null)
            {
                hasMap       = true;
                currentMap   = map;
                currentFloor = 0;
            }
        }
    }
示例#2
0
    void LoadMap()
    {
        if (mapAsset != null)
        {
            mapSerializer = new MapSerializer();
            mapSerializer.Load(mapAsset);

            if (!mapSerializer.IsInitialized())
            {
                Debug.LogWarning("Failed to load map");
            }
            else if ((mapSerializer.Width != width) || (mapSerializer.Height != height))
            {
                Debug.LogWarning("Loaded map is incompatible");
            }
        }
    }