hot fix on map load
This commit is contained in:
parent
1ca4f29729
commit
906cca843d
3 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
|
|
|
@ -28,7 +28,11 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
public void LoadMap(string mapName = "main")
|
public void LoadMap(string mapName = "main")
|
||||||
{
|
{
|
||||||
// Загрузка TileMap
|
// Загрузка TileMap
|
||||||
TileMap tileMap = JsonSerializer.Deserialize<TileMap>(File.ReadAllText(string.Format(_templatePath, mapName)));
|
var options = new JsonSerializerOptions
|
||||||
|
{
|
||||||
|
PropertyNameCaseInsensitive = true
|
||||||
|
};
|
||||||
|
TileMap tileMap = JsonSerializer.Deserialize<TileMap>(File.ReadAllText(string.Format(_templatePath, mapName)), options);
|
||||||
|
|
||||||
// Загрузка TileSet-ов по TileSetInfo
|
// Загрузка TileSet-ов по TileSetInfo
|
||||||
List<TileSet> tileSets = new List<TileSet>();
|
List<TileSet> tileSets = new List<TileSet>();
|
||||||
|
|
Loading…
Add table
Reference in a new issue