diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index 1777a4a..6ef9196 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -109,8 +109,7 @@ roomInfo.PreviewTexture = imageTexture; //---------------------- 填充tile操作 ---------------------- - var tileConfig = GameApplication.Instance.DungeonManager.AutoTileConfig; - var terrainInfo = tileConfig.TerrainInfo; + var terrainInfo = config.TerrainInfo; //底层 for (var i = 0; i < tileInfo.Floor.Count; i += 4) @@ -123,7 +122,7 @@ var index = terrainInfo.TerrainBitToIndex(bit, type); var terrainCell = terrainInfo.GetTerrainCell(index, type); var atlasCoords = terrainInfo.GetPosition(terrainCell); - _tileRoot.SetCell(GameConfig.FloorMapLayer, pos, tileConfig.SourceId, atlasCoords); + _tileRoot.SetCell(GameConfig.FloorMapLayer, pos, config.SourceId, atlasCoords); } //中层 for (var i = 0; i < tileInfo.Middle.Count; i += 4) @@ -136,7 +135,7 @@ var index = terrainInfo.TerrainBitToIndex(bit, type); var terrainCell = terrainInfo.GetTerrainCell(index, type); var atlasCoords = terrainInfo.GetPosition(terrainCell); - _tileRoot.SetCell(GameConfig.MiddleMapLayer, pos, tileConfig.SourceId, atlasCoords); + _tileRoot.SetCell(GameConfig.MiddleMapLayer, pos, config.SourceId, atlasCoords); } //顶层 for (var i = 0; i < tileInfo.Top.Count; i += 4) @@ -149,7 +148,7 @@ var index = terrainInfo.TerrainBitToIndex(bit, type); var terrainCell = terrainInfo.GetTerrainCell(index, type); var atlasCoords = terrainInfo.GetPosition(terrainCell); - _tileRoot.SetCell(GameConfig.TopMapLayer, pos, tileConfig.SourceId, atlasCoords); + _tileRoot.SetCell(GameConfig.TopMapLayer, pos, config.SourceId, atlasCoords); } //寻找可用传送点 diff --git a/DungeonShooting_Godot/src/game/room/World.cs b/DungeonShooting_Godot/src/game/room/World.cs index d6db819..75f8634 100644 --- a/DungeonShooting_Godot/src/game/room/World.cs +++ b/DungeonShooting_Godot/src/game/room/World.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using System.Linq; using Godot; /// @@ -73,10 +74,7 @@ Color = Colors.Black; //临时处理, 加载TileSet - var tileSet = ResourceManager.Load(ResourcePath.resource_tileSet_map2_TileSet2_tres); - //var tileSet = ResourceManager.Load(ResourcePath.resource_tileSet_map1_TileSet1_tres); - //var tileSetAtlasSource = (TileSetAtlasSource)tileSet.GetSource(0); - //tileSetAtlasSource.Texture = ImageTexture.CreateFromImage(Image.LoadFromFile("resource/tileSprite/map1/16x16 dungeon ii wall reconfig v04 spritesheet.png")); + var tileSet = GameApplication.Instance.TileSetConfig.First().Value.GetTileSet(); TileRoot.TileSet = tileSet; //TileRoot.YSortEnabled = false; }