diff --git a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn
index a324d75..3db180e 100644
--- a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn
+++ b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn
@@ -1,8 +1,71 @@
-[gd_scene load_steps=4 format=3 uid="uid://csbxfkdupsckv"]
+[gd_scene load_steps=8 format=3 uid="uid://csbxfkdupsckv"]
[ext_resource type="Script" path="res://src/game/ui/mapEditor/MapEditorPanel.cs" id="1_5s7a0"]
[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_nr5lp"]
[ext_resource type="Script" path="res://src/game/ui/mapEditor/TileView/EditorTileMap.cs" id="2_waq8f"]
+[ext_resource type="Texture2D" uid="uid://0878uloew5jo" path="res://resource/sprite/ui/mapEditor/ErrorCell.png" id="4_465u2"]
+
+[sub_resource type="Animation" id="Animation_wnqg6"]
+resource_name = "show"
+length = 2.0
+loop_mode = 1
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:visible")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 1,
+"values": [true]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath(".:modulate")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0, 0.3, 0.6, 2),
+"transitions": PackedFloat32Array(1, 1, 1, 1),
+"update": 0,
+"values": [Color(1, 0, 0, 0), Color(1, 0, 0, 0.490196), Color(1, 0, 0, 0.490196), Color(1, 0, 0, 0)]
+}
+
+[sub_resource type="Animation" id="Animation_o3btm"]
+length = 0.001
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:visible")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 1,
+"values": [false]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath(".:modulate")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Color(1, 0, 0, 0)]
+}
+
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_371oi"]
+_data = {
+"RESET": SubResource("Animation_o3btm"),
+"show": SubResource("Animation_wnqg6")
+}
[node name="MapEditor" type="Control"]
layout_mode = 3
@@ -54,7 +117,19 @@
format = 2
script = ExtResource("2_waq8f")
-[node name="Draw" type="Node2D" parent="Bg/HSplitContainer/Left/MapView/SubViewport/TileMap"]
+[node name="ErrorCell" type="Sprite2D" parent="Bg/HSplitContainer/Left/MapView/SubViewport/TileMap"]
+visible = false
+modulate = Color(1, 0, 0, 0)
+scale = Vector2(16, 16)
+texture = ExtResource("4_465u2")
+centered = false
+
+[node name="ErrorCellAnimationPlayer" type="AnimationPlayer" parent="Bg/HSplitContainer/Left/MapView/SubViewport/TileMap/ErrorCell"]
+libraries = {
+"": SubResource("AnimationLibrary_371oi")
+}
+
+[node name="Brush" type="Node2D" parent="Bg/HSplitContainer/Left/MapView/SubViewport/TileMap"]
z_index = 100
[node name="CanvasLayer" type="CanvasLayer" parent="Bg/HSplitContainer/Left/MapView/SubViewport"]
diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png
new file mode 100644
index 0000000..e8b825e
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png.import
new file mode 100644
index 0000000..a2f26be
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://0878uloew5jo"
+path="res://.godot/imported/ErrorCell.png-adb91a4f9cc859a7b631f14ff0f58d18.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://resource/sprite/ui/mapEditor/ErrorCell.png"
+dest_files=["res://.godot/imported/ErrorCell.png-adb91a4f9cc859a7b631f14ff0f58d18.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/DungeonShooting_Godot/src/framework/common/SeedRandom.cs b/DungeonShooting_Godot/src/framework/common/SeedRandom.cs
index e9697b3..bc33910 100644
--- a/DungeonShooting_Godot/src/framework/common/SeedRandom.cs
+++ b/DungeonShooting_Godot/src/framework/common/SeedRandom.cs
@@ -28,6 +28,7 @@
var num = dateTime.Year * 100000 + dateTime.Month * 100000 + dateTime.Day * 100000 + dateTime.Hour * 10000 + dateTime.Minute * 100 + dateTime.Second;
num += _staticSeed;
_staticSeed += 11111;
+ Seed = num;
_random = new Random(num);
}
diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs b/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
index b6fb52b..edc97c4 100644
--- a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
+++ b/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
@@ -1027,6 +1027,7 @@
var offset = new Vector2(size.X * 0.5f, size.Y * 0.5f);
//找到路, 向右开始找边界
var startPos = new Vector2(i - 1, j);
+ PutUsePoint(startPos);
var tempI = i;
var tempJ = j;
diff --git a/DungeonShooting_Godot/src/game/AnimatorNames.cs b/DungeonShooting_Godot/src/game/AnimatorNames.cs
index bbe65d1..8ba547d 100644
--- a/DungeonShooting_Godot/src/game/AnimatorNames.cs
+++ b/DungeonShooting_Godot/src/game/AnimatorNames.cs
@@ -56,4 +56,8 @@
/// ui出场
///
public const string Out = "out";
+ ///
+ /// 显示动画
+ ///
+ public const string Show = "show";
}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs
index 31527c8..078c07e 100644
--- a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs
+++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs
@@ -24,12 +24,43 @@
}
///
- /// 类型: , 路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.Draw
+ /// 类型: , 路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.ErrorCell.ErrorCellAnimationPlayer
///
- public class MapEditor_Draw : UiNode
+ public class MapEditor_ErrorCellAnimationPlayer : UiNode
{
- public MapEditor_Draw(MapEditor uiPanel, Godot.Node2D node) : base(uiPanel, node) { }
- public override MapEditor_Draw Clone() => new (UiPanel, (Godot.Node2D)Instance.Duplicate());
+ public MapEditor_ErrorCellAnimationPlayer(MapEditor uiPanel, Godot.AnimationPlayer node) : base(uiPanel, node) { }
+ public override MapEditor_ErrorCellAnimationPlayer Clone() => new (UiPanel, (Godot.AnimationPlayer)Instance.Duplicate());
+ }
+
+ ///
+ /// 类型: , 路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.ErrorCell
+ ///
+ public class MapEditor_ErrorCell : UiNode
+ {
+ ///
+ /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.ErrorCellAnimationPlayer
+ ///
+ public MapEditor_ErrorCellAnimationPlayer L_ErrorCellAnimationPlayer
+ {
+ get
+ {
+ if (_L_ErrorCellAnimationPlayer == null) _L_ErrorCellAnimationPlayer = new MapEditor_ErrorCellAnimationPlayer(UiPanel, Instance.GetNodeOrNull("ErrorCellAnimationPlayer"));
+ return _L_ErrorCellAnimationPlayer;
+ }
+ }
+ private MapEditor_ErrorCellAnimationPlayer _L_ErrorCellAnimationPlayer;
+
+ public MapEditor_ErrorCell(MapEditor uiPanel, Godot.Sprite2D node) : base(uiPanel, node) { }
+ public override MapEditor_ErrorCell Clone() => new (UiPanel, (Godot.Sprite2D)Instance.Duplicate());
+ }
+
+ ///
+ /// 类型: , 路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.Brush
+ ///
+ public class MapEditor_Brush : UiNode
+ {
+ public MapEditor_Brush(MapEditor uiPanel, Godot.Node2D node) : base(uiPanel, node) { }
+ public override MapEditor_Brush Clone() => new (UiPanel, (Godot.Node2D)Instance.Duplicate());
}
///
@@ -38,17 +69,30 @@
public class MapEditor_TileMap : UiNode
{
///
- /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.Draw
+ /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.ErrorCell
///
- public MapEditor_Draw L_Draw
+ public MapEditor_ErrorCell L_ErrorCell
{
get
{
- if (_L_Draw == null) _L_Draw = new MapEditor_Draw(UiPanel, Instance.GetNodeOrNull("Draw"));
- return _L_Draw;
+ if (_L_ErrorCell == null) _L_ErrorCell = new MapEditor_ErrorCell(UiPanel, Instance.GetNodeOrNull("ErrorCell"));
+ return _L_ErrorCell;
}
}
- private MapEditor_Draw _L_Draw;
+ private MapEditor_ErrorCell _L_ErrorCell;
+
+ ///
+ /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.Brush
+ ///
+ public MapEditor_Brush L_Brush
+ {
+ get
+ {
+ if (_L_Brush == null) _L_Brush = new MapEditor_Brush(UiPanel, Instance.GetNodeOrNull("Brush"));
+ return _L_Brush;
+ }
+ }
+ private MapEditor_Brush _L_Brush;
public MapEditor_TileMap(MapEditor uiPanel, UI.MapEditor.EditorTileMap node) : base(uiPanel, node) { }
public override MapEditor_TileMap Clone() => new (UiPanel, (UI.MapEditor.EditorTileMap)Instance.Duplicate());
@@ -210,9 +254,19 @@
///
- /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.Draw
+ /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.ErrorCell.ErrorCellAnimationPlayer
///
- public MapEditor_Draw S_Draw => L_Bg.L_HSplitContainer.L_Left.L_MapView.L_SubViewport.L_TileMap.L_Draw;
+ public MapEditor_ErrorCellAnimationPlayer S_ErrorCellAnimationPlayer => L_Bg.L_HSplitContainer.L_Left.L_MapView.L_SubViewport.L_TileMap.L_ErrorCell.L_ErrorCellAnimationPlayer;
+
+ ///
+ /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.ErrorCell
+ ///
+ public MapEditor_ErrorCell S_ErrorCell => L_Bg.L_HSplitContainer.L_Left.L_MapView.L_SubViewport.L_TileMap.L_ErrorCell;
+
+ ///
+ /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap.Brush
+ ///
+ public MapEditor_Brush S_Brush => L_Bg.L_HSplitContainer.L_Left.L_MapView.L_SubViewport.L_TileMap.L_Brush;
///
/// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer.Left.MapView.SubViewport.TileMap
diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs
index 0780cb3..dc167f3 100644
--- a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs
+++ b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs
@@ -1,4 +1,5 @@
-using Godot;
+using System.Collections.Generic;
+using Godot;
using Godot.Collections;
namespace UI.MapEditor;
@@ -6,6 +7,31 @@
public partial class EditorTileMap : TileMap
{
///
+ /// 自动图块地板层
+ ///
+ public const int AutoFloorLayer = 0;
+ ///
+ /// 自定义图块地板层
+ ///
+ public const int CustomFloorLayer = 1;
+ ///
+ /// 自动图块中间层
+ ///
+ public const int AutoMiddleLayer = 2;
+ ///
+ /// 自定义图块中间层
+ ///
+ public const int CustomMiddleLayer = 3;
+ ///
+ /// 自动图块顶层
+ ///
+ public const int AutoTopLayer = 4;
+ ///
+ /// 自定义图块顶层
+ ///
+ public const int CustomTopLayer = 5;
+
+ ///
/// 所属地图编辑器UI
///
public MapEditorPanel MapEditorPanel { get; set; }
@@ -31,9 +57,38 @@
private bool _drawFullRect = false;
//负责存储自动图块数据
private Grid _autoCellLayerGrid = new Grid();
+ //用于生成导航网格
+ private DungeonTile _dungeonTile;
+ private float _generateNavigationTimer = -1;
+
+ //--------- 配置数据 -------------
+ private int _sourceId = 0;
+ private int _terrainSet = 0;
+ private int _terrain = 0;
+ private Vector2I _floorAtlasCoords = new Vector2I(0, 8);
+ //-------------------------------
+
+ public override void _Ready()
+ {
+ //初始化层级数据
+ AddLayer(CustomFloorLayer);
+ SetLayerZIndex(CustomFloorLayer, CustomFloorLayer);
+ AddLayer(AutoMiddleLayer);
+ SetLayerZIndex(AutoMiddleLayer, AutoMiddleLayer);
+ AddLayer(CustomMiddleLayer);
+ SetLayerZIndex(CustomMiddleLayer, CustomMiddleLayer);
+ AddLayer(AutoTopLayer);
+ SetLayerZIndex(AutoTopLayer, AutoTopLayer);
+ AddLayer(CustomTopLayer);
+ SetLayerZIndex(CustomTopLayer, CustomTopLayer);
+
+ _dungeonTile = new DungeonTile(this);
+ _dungeonTile.SetFloorAtlasCoords(new List(new []{ _floorAtlasCoords }));
+ }
public override void _Process(double delta)
{
+ var newDelta = (float)delta;
_drawFullRect = false;
var position = GetLocalMousePosition();
_mouseCellPosition = LocalToMap(position);
@@ -55,8 +110,6 @@
{
_changeFlag = true;
_prevMouseCellPosition = _mouseCellPosition;
- //绘制单个图块
- //SetCell(GameConfig.FloorMapLayer, _mouseCellPosition, 0, new Vector2I(0,8));
//绘制自动图块
SetSingleAutoCell(_mouseCellPosition);
}
@@ -80,6 +133,17 @@
Position = GetGlobalMousePosition() + _moveOffset;
}
}
+
+ //绘制停止指定时间后, 生成导航网格
+ if (_generateNavigationTimer > 0)
+ {
+ _generateNavigationTimer -= newDelta;
+ if (_generateNavigationTimer <= 0)
+ {
+ GD.Print("开始绘制导航网格...");
+ GenerateNavigation();
+ }
+ }
}
///
@@ -91,6 +155,14 @@
canvasItem.DrawLine(new Vector2(0, 2000), new Vector2(0, -2000), Colors.Green);
canvasItem.DrawLine(new Vector2(2000, 0), new Vector2( -2000, 0), Colors.Red);
+ //绘制导航网格
+ var result = _dungeonTile.GetGenerateNavigationResult();
+ if (result != null && result.Success)
+ {
+ var polygonData = _dungeonTile.GetPolygonData();
+ Utils.DrawNavigationPolygon(canvasItem, polygonData, 1);
+ }
+
if (_drawFullRect) //绘制填充矩形
{
var size = TileSet.TileSize;
@@ -175,6 +247,14 @@
}
}
}
+ else if (@event is InputEventKey eventKey)
+ {
+ //测试生成自动图块
+ if (eventKey.KeyLabel == Key.M && eventKey.Pressed)
+ {
+ GenerateTerrain();
+ }
+ }
}
//缩小
@@ -212,15 +292,16 @@
//绘制单个自动贴图
private void SetSingleAutoCell(Vector2I position)
{
- //绘制自动图块
- var arr = new Array(new [] { position });
- SetCellsTerrainConnect(GameConfig.FloorMapLayer, arr, 0, 0, false);
+ _generateNavigationTimer = 3;
+ SetCell(GetFloorLayer(), position, _sourceId, _floorAtlasCoords);
_autoCellLayerGrid.Set(position.X, position.Y, true);
}
//绘制区域自动贴图
private void SetRectAutoCell(Vector2I start, Vector2I end)
{
+ _generateNavigationTimer = 3;
+
if (start.X > end.X)
{
var temp = end.X;
@@ -236,44 +317,43 @@
var width = end.X - start.X + 1;
var height = end.Y - start.Y + 1;
- var index = 0;
- var array = new Vector2I[width * height];
for (var i = 0; i < width; i++)
{
for (var j = 0; j < height; j++)
{
- array[index++] = new Vector2I(start.X + i, start.Y + j);
+ SetCell(GetFloorLayer(), new Vector2I(start.X + i, start.Y + j), _sourceId, _floorAtlasCoords);
}
}
- var arr = new Array(array);
- SetCellsTerrainConnect(GameConfig.FloorMapLayer, arr, 0, 0, false);
_autoCellLayerGrid.SetRect(start, new Vector2I(width, height), true);
}
//擦除单个自动图块
private void EraseSingleAutoCell(Vector2I position)
{
- EraseCell(GameConfig.FloorMapLayer, position);
+ _generateNavigationTimer = 3;
+ EraseCell(GetFloorLayer(), position);
_autoCellLayerGrid.Remove(position.X, position.Y);
//执行刷墙逻辑
- //先检测对角是否有地板
- var left = _autoCellLayerGrid.Get(position.X - 1, position.Y);
- var right = _autoCellLayerGrid.Get(position.X + 1, position.Y);
- var top = _autoCellLayerGrid.Get(position.X, position.Y + 1);
- var down = _autoCellLayerGrid.Get(position.X, position.Y - 1);
-
- if ((left && right) || (top && down))
- {
- GD.Print("错误的地图块...");
- }
+ // //先检测对角是否有地板
+ // var left = _autoCellLayerGrid.Get(position.X - 1, position.Y);
+ // var right = _autoCellLayerGrid.Get(position.X + 1, position.Y);
+ // var top = _autoCellLayerGrid.Get(position.X, position.Y + 1);
+ // var down = _autoCellLayerGrid.Get(position.X, position.Y - 1);
+ //
+ // if ((left && right) || (top && down))
+ // {
+ // GD.Print("错误的地图块...");
+ // }
}
//擦除一个区域内的自动贴图
private void EraseRectAutoCell(Vector2I start, Vector2I end)
{
+ _generateNavigationTimer = 3;
+
if (start.X > end.X)
{
var temp = end.X;
@@ -293,27 +373,86 @@
{
for (var j = 0; j < height; j++)
{
- EraseCell(GameConfig.FloorMapLayer, new Vector2I(start.X + i, start.Y + j));
+ EraseCell(GetFloorLayer(), new Vector2I(start.X + i, start.Y + j));
}
}
_autoCellLayerGrid.RemoveRect(start, new Vector2I(width, height));
}
+ //生成自动图块 (地形)
+ private void GenerateTerrain()
+ {
+ ClearLayer(AutoFloorLayer);
+ var list = new List();
+ _autoCellLayerGrid.ForEach((x, y, data) =>
+ {
+ if (data)
+ {
+ list.Add(new Vector2I(x, y));
+ }
+ });
+ var arr = new Array(list);
+ SetCellsTerrainConnect(AutoFloorLayer, arr, _terrainSet, _terrain, false);
+ }
+
+ //生成导航网格
+ private void GenerateNavigation()
+ {
+ _dungeonTile.GenerateNavigationPolygon(AutoFloorLayer);
+ var result = _dungeonTile.GetGenerateNavigationResult();
+ if (result.Success)
+ {
+ MapEditorPanel.S_ErrorCellAnimationPlayer.Instance.Stop();
+ }
+ else
+ {
+ MapEditorPanel.S_ErrorCell.Instance.Position = result.Exception.Point * CellQuadrantSize;
+ MapEditorPanel.S_ErrorCellAnimationPlayer.Instance.Play(AnimatorNames.Show);
+ }
+ }
+
+ private int GetFloorLayer()
+ {
+ return AutoFloorLayer;
+ }
+
+ private int GetMiddleLayer()
+ {
+ return AutoMiddleLayer;
+ }
+
+ private int GetTopLayer()
+ {
+ return AutoTopLayer;
+ }
+
+ ///
+ /// 选中拖拽功能
+ ///
public void OnSelectHandTool()
{
}
+ ///
+ /// 选中画笔攻击
+ ///
public void OnSelectPenTool()
{
- GD.Print("....");
+
}
+ ///
+ /// 选中绘制区域功能
+ ///
public void OnSelectRectTool()
{
}
+ ///
+ /// 聚焦
+ ///
public void OnClickCenterTool()
{
Position = MapEditorPanel.S_SubViewport.Instance.Size / 2;
diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs
index 2865b79..72b9594 100644
--- a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs
+++ b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMapBar.cs
@@ -16,7 +16,7 @@
public void OnShow()
{
- _editorTileMap.L_Draw.Instance.Draw += OnDrawGuides;
+ _editorTileMap.L_Brush.Instance.Draw += OnDrawGuides;
_editorPanel.ToolsPanel.S_HandTool.Instance.Pressed += _editorTileMap.Instance.OnSelectHandTool;
_editorPanel.ToolsPanel.S_PenTool.Instance.Pressed += _editorTileMap.Instance.OnSelectPenTool;
_editorPanel.ToolsPanel.S_RectTool.Instance.Pressed += _editorTileMap.Instance.OnSelectRectTool;
@@ -25,7 +25,7 @@
public void OnHide()
{
- _editorTileMap.L_Draw.Instance.Draw -= OnDrawGuides;
+ _editorTileMap.L_Brush.Instance.Draw -= OnDrawGuides;
_editorPanel.ToolsPanel.S_HandTool.Instance.Pressed -= _editorTileMap.Instance.OnSelectHandTool;
_editorPanel.ToolsPanel.S_PenTool.Instance.Pressed -= _editorTileMap.Instance.OnSelectPenTool;
_editorPanel.ToolsPanel.S_RectTool.Instance.Pressed -= _editorTileMap.Instance.OnSelectRectTool;
@@ -34,11 +34,11 @@
public void Process(float delta)
{
- _editorTileMap.L_Draw.Instance.QueueRedraw();
+ _editorTileMap.L_Brush.Instance.QueueRedraw();
}
private void OnDrawGuides()
{
- _editorTileMap.Instance.DrawGuides(_editorTileMap.L_Draw.Instance);
+ _editorTileMap.Instance.DrawGuides(_editorTileMap.L_Brush.Instance);
}
}
\ No newline at end of file