diff --git a/DungeonShooting_Godot/prefab/role/Enemy.tscn b/DungeonShooting_Godot/prefab/role/Enemy.tscn
index d5204e2..6a76c2e 100644
--- a/DungeonShooting_Godot/prefab/role/Enemy.tscn
+++ b/DungeonShooting_Godot/prefab/role/Enemy.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=19 format=2]
+[gd_scene load_steps=20 format=2]
[ext_resource path="res://prefab/role/Role.tscn" type="PackedScene" id=1]
[ext_resource path="res://resource/materlal/Blend.gdshader" type="Shader" id=2]
@@ -82,6 +82,9 @@
"speed": 10.0
} ]
+[sub_resource type="CircleShape2D" id=20]
+radius = 4.0
+
[node name="Enemy" instance=ExtResource( 1 )]
CollisionLayer = 16
CollisionMask = 25
@@ -94,6 +97,9 @@
frames = SubResource( 19 )
playing = true
+[node name="Collision" parent="." index="3"]
+shape = SubResource( 20 )
+
[node name="ViewRay" type="RayCast2D" parent="." index="6"]
position = Vector2( 0, -8 )
diff --git a/DungeonShooting_Godot/prefab/role/Player.tscn b/DungeonShooting_Godot/prefab/role/Player.tscn
index 2bc57cd..d1bea43 100644
--- a/DungeonShooting_Godot/prefab/role/Player.tscn
+++ b/DungeonShooting_Godot/prefab/role/Player.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=19 format=2]
+[gd_scene load_steps=20 format=2]
[ext_resource path="res://prefab/role/Role.tscn" type="PackedScene" id=1]
[ext_resource path="res://resource/materlal/Blend.gdshader" type="Shader" id=2]
@@ -82,6 +82,9 @@
"speed": 10.0
} ]
+[sub_resource type="CircleShape2D" id=32]
+radius = 4.0
+
[node name="Player" instance=ExtResource( 1 )]
CollisionLayer = 8
CollisionMask = 25
@@ -93,3 +96,7 @@
material = SubResource( 2 )
frames = SubResource( 19 )
playing = true
+
+[node name="Collision" parent="." index="3"]
+position = Vector2( 0, -3 )
+shape = SubResource( 32 )
diff --git a/DungeonShooting_Godot/prefab/role/Role.tscn b/DungeonShooting_Godot/prefab/role/Role.tscn
index fe7b6c2..cf76585 100644
--- a/DungeonShooting_Godot/prefab/role/Role.tscn
+++ b/DungeonShooting_Godot/prefab/role/Role.tscn
@@ -11,7 +11,7 @@
shader_param/blend = Color( 1, 1, 1, 1 )
shader_param/schedule = 0.0
-[sub_resource type="CircleShape2D" id=34]
+[sub_resource type="CircleShape2D" id=36]
radius = 4.0
[sub_resource type="RectangleShape2D" id=35]
@@ -36,9 +36,8 @@
position = Vector2( 0, -12 )
[node name="Collision" type="CollisionShape2D" parent="."]
-visible = false
position = Vector2( 0, -4 )
-shape = SubResource( 34 )
+shape = SubResource( 36 )
[node name="HurtArea" type="Area2D" parent="."]
collision_layer = 0
diff --git a/DungeonShooting_Godot/scene/Main.tscn b/DungeonShooting_Godot/scene/Main.tscn
index aff7b6d..35a4274 100644
--- a/DungeonShooting_Godot/scene/Main.tscn
+++ b/DungeonShooting_Godot/scene/Main.tscn
@@ -24,6 +24,7 @@
[node name="Main" type="Node2D"]
script = ExtResource( 3 )
+Debug = true
CursorPack = ExtResource( 4 )
RoomPath = NodePath("ViewCanvas/ViewportContainer/Viewport/Room")
ViewportPath = NodePath("ViewCanvas/ViewportContainer/Viewport")
diff --git a/DungeonShooting_Godot/scene/Room.tscn b/DungeonShooting_Godot/scene/Room.tscn
index 3bfad78..ca08ce2 100644
--- a/DungeonShooting_Godot/scene/Room.tscn
+++ b/DungeonShooting_Godot/scene/Room.tscn
@@ -10,6 +10,9 @@
[node name="Room" type="Navigation2D"]
script = ExtResource( 3 )
+ObjectRootPath = NodePath("ObjectRoot")
+SortRootPath = NodePath("SortRoot")
+MapRootPath = NodePath("MapRoot")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 1 )
diff --git a/DungeonShooting_Godot/src/game/room/RoomManager.cs b/DungeonShooting_Godot/src/game/room/RoomManager.cs
index 1d6346f..827fe5d 100644
--- a/DungeonShooting_Godot/src/game/room/RoomManager.cs
+++ b/DungeonShooting_Godot/src/game/room/RoomManager.cs
@@ -8,6 +8,10 @@
///
public class RoomManager : Navigation2D
{
+ [Export] public NodePath ObjectRootPath;
+ [Export] public NodePath SortRootPath;
+ [Export] public NodePath MapRootPath;
+
///
/// 玩家对象
///
@@ -42,16 +46,16 @@
//Engine.TimeScale = 0.2f;
Input.MouseMode = Input.MouseModeEnum.Hidden;
- _sortRoot = GetNode("SortRoot");
- _objectRoot = GetNode("ObjectRoot");
+ _sortRoot = GetNode(SortRootPath);
+ _objectRoot = GetNode(ObjectRootPath);
NavigationPolygon = new NavigationPolygonInstance();
AddChild(NavigationPolygon);
//初始化地图
- _mapRoot = GetNode("MapRoot");
+ _mapRoot = GetNode(MapRootPath);
var child = _mapRoot.GetChild(0);
- _tileMap = child.GetNode("Ground");
+ _tileMap = child.GetNode("Wall");
var node = child.GetNode("Config");
Color color = (Color)node.GetMeta("ClearColor");
VisualServer.SetDefaultClearColor(color);