diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/ActivityObjectTemplate.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/ActivityObjectTemplate.cs deleted file mode 100644 index 28640fa..0000000 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/ActivityObjectTemplate.cs +++ /dev/null @@ -1,134 +0,0 @@ -using Godot; - -namespace Plugin -{ - /// - /// ActivityObject 节点模板对象 - /// - [Tool] - public partial class ActivityObjectTemplate : Node - { - /// - /// 是否放入 ySort 节点下 - /// - [Export] public bool UseYSort; - - /// - /// 物体初始缩放 - /// - [Export] public Vector2 scale = Vector2.One; - - /// - /// 当前物体所属物理层 - /// - [Export(PropertyHint.Layers2DPhysics)] public uint collision_layer; - - /// - /// 当前物体扫描的物理层 - /// - [Export(PropertyHint.Layers2DPhysics)] public uint collision_mask; - - /// - /// 显示状态 - /// - [Export] public bool visible = true; - - /// - /// 当前物体渲染层级 - /// - [Export] public int z_index; - - public override void _Ready() - { -#if TOOLS - // 在工具模式下创建的 template 节点自动创建对应的必要子节点 - if (Engine.IsEditorHint()) - { - var parent = GetParent(); - if (parent != null) - { - //寻找 owner - Node owner; - if (parent.Owner != null) - { - owner = parent.Owner; - } - else if (Plugin.Instance.GetEditorInterface().GetEditedSceneRoot() == this) - { - owner = this; - } - else - { - owner = parent; - } - - var sprite = GetNodeOrNull("ShadowSprite"); - //创建Shadow - if (sprite == null) - { - sprite = new Sprite2D(); - sprite.Name = "ShadowSprite"; - sprite.ZIndex = -5; - var material = - ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); - material.SetShaderParameter("blend", new Color(0, 0, 0, 0.47058824F)); - material.SetShaderParameter("schedule", 1); - sprite.Material = material; - AddChild(sprite); - sprite.Owner = owner; - } - else if (sprite.Material == null) - { - var material = - ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); - material.SetShaderParameter("blend", new Color(0, 0, 0, 0.47058824F)); - material.SetShaderParameter("schedule", 1); - sprite.Material = material; - } - - var animatedSprite = GetNodeOrNull("AnimatedSprite"); - //创建 Sprite2D - if (animatedSprite == null) - { - animatedSprite = new AnimatedSprite2D(); - animatedSprite.Name = "AnimatedSprite"; - var material = - ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); - material.SetShaderParameter("blend", new Color(1, 1, 1, 1)); - material.SetShaderParameter("schedule", 0); - animatedSprite.Material = material; - AddChild(animatedSprite); - animatedSprite.Owner = owner; - } - else if (animatedSprite.Material == null) - { - var material = - ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); - material.SetShaderParameter("blend", new Color(1, 1, 1, 1)); - material.SetShaderParameter("schedule", 0); - animatedSprite.Material = material; - } - - //创建Collision - if (GetNodeOrNull("Collision") == null) - { - var co = new CollisionShape2D(); - co.Name = "Collision"; - AddChild(co); - co.Owner = owner; - } - - //创建AnimationPlayer - if (GetNodeOrNull("AnimationPlayer") == null) - { - var ap = new AnimationPlayer(); - ap.Name = "AnimationPlayer"; - AddChild(ap); - ap.Owner = owner; - } - } - } -#endif - } - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/prefab/effect/BulletSmoke.tscn b/DungeonShooting_Godot/prefab/effect/BulletSmoke.tscn index 061043d..7911e4a 100644 --- a/DungeonShooting_Godot/prefab/effect/BulletSmoke.tscn +++ b/DungeonShooting_Godot/prefab/effect/BulletSmoke.tscn @@ -1,147 +1,150 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=3 uid="uid://dtr8nurmv2qtg"] -[ext_resource path="res://resource/effects/Smoke.png" type="Texture2D" id=1] -[ext_resource path="res://resource/effects/Collision.png" type="Texture2D" id=2] +[ext_resource type="Texture2D" uid="uid://h7hkgbwj1li" path="res://resource/effects/Smoke.png" id="1"] +[ext_resource type="Texture2D" uid="uid://dwa4chrugc6b1" path="res://resource/effects/Collision.png" id="2"] -[sub_resource type="CanvasItemMaterial" id=1] +[sub_resource type="CanvasItemMaterial" id="1"] particles_animation = true particles_anim_h_frames = 3 particles_anim_v_frames = 1 particles_anim_loop = false -[sub_resource type="Curve" id=3] -_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.108939, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ] +[sub_resource type="Curve" id="Curve_kve5o"] +_data = [Vector2(0.00645161, 0), 0.0, 0.0, 0, 0, Vector2(0.151613, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 3 -[sub_resource type="CurveTexture" id=4] -curve = SubResource( 3 ) +[sub_resource type="CurveTexture" id="CurveTexture_yr1bt"] +curve = SubResource("Curve_kve5o") -[sub_resource type="ParticleProcessMaterial" id=2] -flag_disable_z = true +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_gpp81"] +lifetime_randomness = 0.5 +particle_flag_disable_z = true spread = 25.0 -gravity = Vector3( 0, 0, 0 ) -initial_velocity = 90.0 -initial_velocity_random = 0.9 -angular_velocity = 360.0 -angular_velocity_random = 1.0 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -angle = 360.0 -angle_random = 1.0 -scale_curve = SubResource( 4 ) -color = Color( 0.470588, 0.470588, 0.470588, 0.470588 ) -anim_offset = 1.0 -anim_offset_random = 1.0 +gravity = Vector3(0, 0, 0) +initial_velocity_max = 90.0 +orbit_velocity_min = 0.0 +orbit_velocity_max = 0.0 +angle_max = 360.0 +scale_curve = SubResource("CurveTexture_yr1bt") +color = Color(0.75, 0.75, 0.75, 0.470588) -[sub_resource type="Animation" id=5] +[sub_resource type="Animation" id="5"] length = 0.001 tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true tracks/0/path = NodePath(".:emitting") tracks/0/interp = 1 tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true tracks/0/keys = { -"times": PackedFloat32Array( 0 ), -"transitions": PackedFloat32Array( 1 ), +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), "update": 0, -"values": [ false ] +"values": [false] } tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true tracks/1/path = NodePath("Sprite2D:frame") tracks/1/interp = 1 tracks/1/loop_wrap = true -tracks/1/imported = false -tracks/1/enabled = true tracks/1/keys = { -"times": PackedFloat32Array( 0 ), -"transitions": PackedFloat32Array( 1 ), +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), "update": 0, -"values": [ 0 ] +"values": [0] } tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true tracks/2/path = NodePath("Sprite2D:visible") tracks/2/interp = 1 tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true tracks/2/keys = { -"times": PackedFloat32Array( 0 ), -"transitions": PackedFloat32Array( 1 ), +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), "update": 0, -"values": [ true ] +"values": [true] } -[sub_resource type="Animation" id=6] +[sub_resource type="Animation" id="6"] resource_name = "Smoke" step = 0.05 tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true tracks/0/path = NodePath(".:emitting") tracks/0/interp = 1 tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true tracks/0/keys = { -"times": PackedFloat32Array( 0 ), -"transitions": PackedFloat32Array( 1 ), +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), "update": 1, -"values": [ true ] +"values": [true] } tracks/1/type = "method" +tracks/1/imported = false +tracks/1/enabled = true tracks/1/path = NodePath(".") tracks/1/interp = 1 tracks/1/loop_wrap = true -tracks/1/imported = false -tracks/1/enabled = true tracks/1/keys = { -"times": PackedFloat32Array( 1 ), -"transitions": PackedFloat32Array( 1 ), -"values": [ { -"args": [ ], -"method": "queue_free" -} ] +"times": PackedFloat32Array(1), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"queue_free" +}] } tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true tracks/2/path = NodePath("Sprite2D:frame") tracks/2/interp = 1 tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true tracks/2/keys = { -"times": PackedFloat32Array( 0, 0.05, 0.1, 0.15 ), -"transitions": PackedFloat32Array( 1, 1, 1, 1 ), +"times": PackedFloat32Array(0, 0.05, 0.1, 0.15), +"transitions": PackedFloat32Array(1, 1, 1, 1), "update": 1, -"values": [ 0, 1, 2, 3 ] +"values": [0, 1, 2, 3] } tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true tracks/3/path = NodePath("Sprite2D:visible") tracks/3/interp = 1 tracks/3/loop_wrap = true -tracks/3/imported = false -tracks/3/enabled = true tracks/3/keys = { -"times": PackedFloat32Array( 0, 0.2 ), -"transitions": PackedFloat32Array( 1, 1 ), +"times": PackedFloat32Array(0, 0.2), +"transitions": PackedFloat32Array(1, 1), "update": 1, -"values": [ true, false ] +"values": [true, false] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_uuiu7"] +_data = { +"RESET": SubResource("5"), +"Smoke": SubResource("6") } [node name="BulletSmoke" type="GPUParticles2D"] -material = SubResource( 1 ) +material = SubResource("1") emitting = false +process_material = SubResource("ParticleProcessMaterial_gpp81") +texture = ExtResource("1") lifetime = 0.4 one_shot = true explosiveness = 0.9 fixed_fps = 20 -process_material = SubResource( 2 ) -texture = ExtResource( 1 ) [node name="Sprite2D" type="Sprite2D" parent="."] -modulate = Color( 1.6, 1.6, 1.6, 1 ) -texture = ExtResource( 2 ) -offset = Vector2( 8, 0 ) +modulate = Color(1.6, 1.6, 1.6, 1) +texture = ExtResource("2") +offset = Vector2(8, 0) hframes = 4 [node name="AnimationPlayer" type="AnimationPlayer" parent="."] autoplay = "Smoke" -anims/RESET = SubResource( 5 ) -anims/Smoke = SubResource( 6 ) +libraries = { +"": SubResource("AnimationLibrary_uuiu7") +} diff --git a/DungeonShooting_Godot/prefab/role/Role.tscn b/DungeonShooting_Godot/prefab/role/Role.tscn index b585f15..d7abcb7 100644 --- a/DungeonShooting_Godot/prefab/role/Role.tscn +++ b/DungeonShooting_Godot/prefab/role/Role.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=10 format=3 uid="uid://4v6441urmwrf"] -[ext_resource type="Script" path="res://addons/dungeonShooting_plugin/ActivityObjectTemplate.cs" id="2"] +[ext_resource type="Script" path="res://src/framework/ActivityObjectTemplate.cs" id="1_hm41b"] [ext_resource type="Shader" path="res://resource/materlal/Blend.gdshader" id="2_q6jwp"] [ext_resource type="Script" path="res://src/game/role/MountRotation.cs" id="4"] @@ -28,11 +28,10 @@ [sub_resource type="AnimationLibrary" id="AnimationLibrary_7yld5"] [node name="Role" type="Node"] -script = ExtResource("2") -UseYSort = true +script = ExtResource("1_hm41b") [node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -5 +z_index = -1 material = SubResource("ShaderMaterial_v2kfw") [node name="BackMountPoint" type="Marker2D" parent="."] diff --git a/DungeonShooting_Godot/prefab/test/TestActivity.tscn b/DungeonShooting_Godot/prefab/test/TestActivity.tscn index 1d72d2e..31fa64c 100644 --- a/DungeonShooting_Godot/prefab/test/TestActivity.tscn +++ b/DungeonShooting_Godot/prefab/test/TestActivity.tscn @@ -1,7 +1,7 @@ -[gd_scene load_steps=7 format=3 uid="uid://bx0krba7eguqp"] +[gd_scene load_steps=7 format=3] [ext_resource type="Shader" path="res://resource/materlal/Blend.gdshader" id="1"] -[ext_resource type="Script" path="res://addons/dungeonShooting_plugin/ActivityObjectTemplate.cs" id="2"] +[ext_resource type="Script" path="res://src/framework/ActivityObjectTemplate.cs" id="2"] [ext_resource type="Texture2D" uid="uid://uhhfgdhpk7i4" path="res://icon.png" id="3"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_rxkv3"] diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon.tscn index 5cd1282..17d75f7 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=9 format=3 uid="uid://cguea7a1vauvm"] [ext_resource type="Shader" path="res://resource/materlal/Blend.gdshader" id="1"] -[ext_resource type="Script" path="res://addons/dungeonShooting_plugin/ActivityObjectTemplate.cs" id="3"] +[ext_resource type="Script" path="res://src/framework/ActivityObjectTemplate.cs" id="1_dtam7"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] resource_local_to_scene = true @@ -57,10 +57,10 @@ } [node name="Weapon" type="Node"] -script = ExtResource("3") +script = ExtResource("1_dtam7") [node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -5 +z_index = -1 material = SubResource("ShaderMaterial_cbiyh") [node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] diff --git a/DungeonShooting_Godot/prefab/weapon/bullet/Bullet.tscn b/DungeonShooting_Godot/prefab/weapon/bullet/Bullet.tscn index ef9a9ce..46b5cae 100644 --- a/DungeonShooting_Godot/prefab/weapon/bullet/Bullet.tscn +++ b/DungeonShooting_Godot/prefab/weapon/bullet/Bullet.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=9 format=3 uid="uid://dlj2qtrqxph0a"] +[gd_scene load_steps=9 format=3 uid="uid://b11ncboik0a7f"] -[ext_resource type="Script" path="res://addons/dungeonShooting_plugin/ActivityObjectTemplate.cs" id="1"] +[ext_resource type="Script" path="res://src/framework/ActivityObjectTemplate.cs" id="1_nwypj"] [ext_resource type="Shader" path="res://resource/materlal/Blend.gdshader" id="2"] [ext_resource type="Texture2D" uid="uid://bu0b11hiuecxy" path="res://resource/sprite/bullet/bullet.png" id="3"] @@ -34,14 +34,15 @@ size = Vector2(11, 4) [node name="Bullet" type="Node"] -script = ExtResource("1") +script = ExtResource("1_nwypj") collision_mask = 1 [node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -5 +z_index = -1 material = SubResource("ShaderMaterial_5a4f2") [node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +modulate = Color(1.8, 1.8, 1.8, 1) material = SubResource("ShaderMaterial_o0655") sprite_frames = SubResource("SpriteFrames_5wvmf") diff --git a/DungeonShooting_Godot/prefab/weapon/shell/ShellCase.tscn b/DungeonShooting_Godot/prefab/weapon/shell/ShellCase.tscn index 04225e6..8d091f5 100644 --- a/DungeonShooting_Godot/prefab/weapon/shell/ShellCase.tscn +++ b/DungeonShooting_Godot/prefab/weapon/shell/ShellCase.tscn @@ -1,8 +1,8 @@ -[gd_scene load_steps=9 format=3 uid="uid://dp6n6l6wq1hvs"] +[gd_scene load_steps=10 format=3 uid="uid://eaqea7rdp3tm"] [ext_resource type="Texture2D" uid="uid://dto03bc2qbhnj" path="res://resource/sprite/shell/shellCase.png" id="1"] +[ext_resource type="Script" path="res://src/framework/ActivityObjectTemplate.cs" id="1_nmhqm"] [ext_resource type="Shader" path="res://resource/materlal/Blend.gdshader" id="2"] -[ext_resource type="Script" path="res://addons/dungeonShooting_plugin/ActivityObjectTemplate.cs" id="3"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_px12l"] resource_local_to_scene = true @@ -27,19 +27,61 @@ "speed": 5.0 }] +[sub_resource type="Animation" id="Animation_pfprw"] +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": [true] +} + [sub_resource type="Animation" id="Animation_kjsto"] resource_name = "flicker" +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, 0.5, 0.6, 0.7, 0.8, 0.9, 1), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [true, true, false, true, false, true, false] +} +tracks/1/type = "method" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(1), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"queue_free" +}] +} [sub_resource type="AnimationLibrary" id="AnimationLibrary_cpq4j"] _data = { +"RESET": SubResource("Animation_pfprw"), "flicker": SubResource("Animation_kjsto") } [node name="ShellCase" type="Node"] -script = ExtResource("3") +script = ExtResource("1_nmhqm") [node name="ShadowSprite" type="Sprite2D" parent="."] -z_index = -5 +z_index = -1 material = SubResource("ShaderMaterial_px12l") [node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] diff --git a/DungeonShooting_Godot/project.godot b/DungeonShooting_Godot/project.godot index 4d7f1d8..e47983c 100644 --- a/DungeonShooting_Godot/project.godot +++ b/DungeonShooting_Godot/project.godot @@ -24,7 +24,6 @@ window/size/viewport_width=1920 window/size/viewport_height=1080 window/size/resizable=false -window/stretch/mode="2d" window/stretch/aspect="keep_width" window/vsync/use_vsync=false @@ -181,6 +180,7 @@ [rendering] +environment/defaults/default_clear_color=Color(0.109804, 0.0666667, 0.0901961, 1) textures/canvas_textures/default_texture_filter=0 2d/snapping/use_gpu_pixel_snap=true environment/default_environment="res://default_env.tres" diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index 2c2c877..4d763c4 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -350,7 +350,7 @@ [sub_resource type="ImageTexture" id="58"] -[sub_resource type="Image" id="Image_l8r85"] +[sub_resource type="Image" id="Image_ayhgc"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -360,7 +360,7 @@ } [sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_l8r85") +image = SubResource("Image_ayhgc") [sub_resource type="StyleBoxTexture" id="61"] content_margin_left = 2.0 @@ -370,7 +370,7 @@ texture = SubResource("60") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_uanwj"] +[sub_resource type="Image" id="Image_xhr4f"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -380,7 +380,7 @@ } [sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_uanwj") +image = SubResource("Image_xhr4f") [sub_resource type="StyleBoxTexture" id="64"] content_margin_left = 2.0 @@ -390,7 +390,7 @@ texture = SubResource("63") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_mi3q6"] +[sub_resource type="Image" id="Image_yov8p"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -400,7 +400,7 @@ } [sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_mi3q6") +image = SubResource("Image_yov8p") [sub_resource type="StyleBoxTexture" id="67"] content_margin_left = 2.0 @@ -410,7 +410,7 @@ texture = SubResource("66") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_7cnxm"] +[sub_resource type="Image" id="Image_fc1nk"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -420,7 +420,7 @@ } [sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_7cnxm") +image = SubResource("Image_fc1nk") [sub_resource type="StyleBoxTexture" id="70"] content_margin_left = 0.0 @@ -444,7 +444,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_ndfnq"] +[sub_resource type="Image" id="Image_o7njb"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -454,7 +454,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_ndfnq") +image = SubResource("Image_o7njb") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/scene/Main.tscn b/DungeonShooting_Godot/scene/Main.tscn index 6612bc6..2319b6a 100644 --- a/DungeonShooting_Godot/scene/Main.tscn +++ b/DungeonShooting_Godot/scene/Main.tscn @@ -26,7 +26,7 @@ script = ExtResource("3") Debug = true CursorPack = ExtResource("4") -RoomPath = NodePath("ViewCanvas/SubViewportContainer/SubViewport/Node3D") +RoomPath = NodePath("ViewCanvas/SubViewportContainer/SubViewport/Room") ViewportPath = NodePath("ViewCanvas/SubViewportContainer/SubViewport") ViewportContainerPath = NodePath("ViewCanvas/SubViewportContainer") UiPath = NodePath("UiCanvas/RoomUI") @@ -54,7 +54,7 @@ size = Vector2i(482, 272) render_target_update_mode = 4 -[node name="Node3D" parent="ViewCanvas/SubViewportContainer/SubViewport" instance=ExtResource("1")] +[node name="Room" parent="ViewCanvas/SubViewportContainer/SubViewport" instance=ExtResource("1")] [node name="GlobalNodeRoot" type="Node2D" parent="."] diff --git a/DungeonShooting_Godot/scene/Room.tscn b/DungeonShooting_Godot/scene/Room.tscn index 68cf3e1..c71a855 100644 --- a/DungeonShooting_Godot/scene/Room.tscn +++ b/DungeonShooting_Godot/scene/Room.tscn @@ -7,6 +7,7 @@ [sub_resource type="Environment" id="1"] background_mode = 4 glow_enabled = true +glow_intensity = 3.0 [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_rkmbu"] texture = ExtResource("1") @@ -567,6 +568,7 @@ ObjectRoot = NodePath("ObjectRoot") YSortRoot = NodePath("SortRoot") TileRoot = NodePath("SortRoot/TileRoot") +metadata/_edit_vertical_guides_ = [] [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("1") @@ -579,15 +581,17 @@ script = ExtResource("5") [node name="ObjectRoot" type="Node2D" parent="."] +z_index = -1 [node name="SortRoot" type="Node2D" parent="."] +y_sort_enabled = true [node name="TileRoot" type="TileMap" parent="SortRoot"] y_sort_enabled = true tile_set = SubResource("TileSet_bspf4") format = 2 -layer_0/name = "Top" -layer_0/tile_data = PackedInt32Array(458756, 65537, 2, 524292, 65537, 3, 589828, 65537, 4, 655364, 65537, 5, 720900, 65537, 6, 786436, 65537, 7, 458757, 131073, 2, 524293, 131073, 3, 589829, 131073, 4, 655365, 131073, 5, 720901, 131073, 6, 786437, 131073, 7, 458758, 196609, 2, 524294, 196609, 3, 589830, 196609, 4, 655366, 196609, 5, 720902, 196609, 6, 786438, 196609, 7) +layer_0/name = "Floor" +layer_0/z_index = -10 layer_1/name = "Middle" layer_1/enabled = true layer_1/modulate = Color(1, 1, 1, 1) @@ -595,10 +599,10 @@ layer_1/y_sort_origin = 0 layer_1/z_index = 0 layer_1/tile_data = PackedInt32Array() -layer_2/name = "Floor" +layer_2/name = "Top" layer_2/enabled = true layer_2/modulate = Color(1, 1, 1, 1) layer_2/y_sort_enabled = false layer_2/y_sort_origin = 0 -layer_2/z_index = 0 +layer_2/z_index = 10 layer_2/tile_data = PackedInt32Array() diff --git a/DungeonShooting_Godot/src/framework/ActivityObject.cs b/DungeonShooting_Godot/src/framework/ActivityObject.cs index bc1e1bd..428dd14 100644 --- a/DungeonShooting_Godot/src/framework/ActivityObject.cs +++ b/DungeonShooting_Godot/src/framework/ActivityObject.cs @@ -103,8 +103,11 @@ //标记字典 private Dictionary _signMap; + private static long _index = 0; + public ActivityObject(string scenePath) { + Name = GetType().Name + (_index++); //加载预制体 var tempPrefab = ResourceManager.Load(scenePath); if (tempPrefab == null) @@ -337,19 +340,19 @@ /// /// 将一个节点扔到地上, 并设置显示的阴影 + /// 是否放到 ySort 下 /// - public virtual void PutDown() + public virtual void PutDown(bool useYSort = false) { var parent = GetParent(); - var root = GameApplication.Instance.RoomManager.GetRoot(UseYSort); - if (parent != root) + if (parent != (useYSort ? GameApplication.Instance.RoomManager.YSortRoot : GameApplication.Instance.RoomManager.ObjectRoot)) { if (parent != null) { parent.RemoveChild(this); } - root.AddChild(this); + this.AddToActivityRoot(useYSort); } if (IsInsideTree()) @@ -367,9 +370,10 @@ /// 将一个节点扔到地上, 并设置显示的阴影 /// /// 放置的位置 - public void PutDown(Vector2 position) + /// 是否放到 ySort 下 + public void PutDown(Vector2 position, bool useYSort = false) { - PutDown(); + PutDown(useYSort); Position = position; } @@ -762,16 +766,14 @@ { var parent = GetParent(); //投抛时必须要加入 sortRoot 节点下 - var root = GameApplication.Instance.RoomManager.GetRoot(); - var throwRoot = GameApplication.Instance.RoomManager.GetRoot(true); if (parent == null) { - throwRoot.AddChild(this); + this.AddToActivityRoot(true); } - else if (parent == root) + else if (parent == GameApplication.Instance.RoomManager.ObjectRoot) { parent.RemoveChild(this); - throwRoot.AddChild(this); + this.AddToActivityRoot(true); } GlobalPosition = _throwData.StartPosition; @@ -855,7 +857,7 @@ MoveController.RemoveForce(_throwData.ThrowForce); GetParent().RemoveChild(this); - GameApplication.Instance.RoomManager.GetRoot(UseYSort).AddChild(this); + this.AddToActivityRoot(UseYSort); RestoreCollision(); OnThrowOver(); diff --git a/DungeonShooting_Godot/src/framework/ActivityObjectTemplate.cs b/DungeonShooting_Godot/src/framework/ActivityObjectTemplate.cs new file mode 100644 index 0000000..68b9572 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ActivityObjectTemplate.cs @@ -0,0 +1,134 @@ +using Godot; + +namespace Plugin +{ + /// + /// ActivityObject 节点模板对象 + /// + [Tool] + public partial class ActivityObjectTemplate : Node + { + /// + /// 是否放入 ySort 节点下 + /// + [Export] public bool UseYSort; + + /// + /// 物体初始缩放 + /// + [Export] public Vector2 scale = Vector2.One; + + /// + /// 当前物体所属物理层 + /// + [Export(PropertyHint.Layers2DPhysics)] public uint collision_layer; + + /// + /// 当前物体扫描的物理层 + /// + [Export(PropertyHint.Layers2DPhysics)] public uint collision_mask; + + /// + /// 显示状态 + /// + [Export] public bool visible = true; + + /// + /// 当前物体渲染层级 + /// + [Export] public int z_index; + + public override void _Ready() + { +#if TOOLS + // 在工具模式下创建的 template 节点自动创建对应的必要子节点 + if (Engine.IsEditorHint()) + { + var parent = GetParent(); + if (parent != null) + { + //寻找 owner + Node owner; + if (parent.Owner != null) + { + owner = parent.Owner; + } + else if (Plugin.Instance.GetEditorInterface().GetEditedSceneRoot() == this) + { + owner = this; + } + else + { + owner = parent; + } + + var sprite = GetNodeOrNull("ShadowSprite"); + //创建Shadow + if (sprite == null) + { + sprite = new Sprite2D(); + sprite.Name = "ShadowSprite"; + sprite.ZIndex = -1; + var material = + ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); + material.SetShaderParameter("blend", new Color(0, 0, 0, 0.47058824F)); + material.SetShaderParameter("schedule", 1); + sprite.Material = material; + AddChild(sprite); + sprite.Owner = owner; + } + else if (sprite.Material == null) + { + var material = + ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); + material.SetShaderParameter("blend", new Color(0, 0, 0, 0.47058824F)); + material.SetShaderParameter("schedule", 1); + sprite.Material = material; + } + + var animatedSprite = GetNodeOrNull("AnimatedSprite"); + //创建 Sprite2D + if (animatedSprite == null) + { + animatedSprite = new AnimatedSprite2D(); + animatedSprite.Name = "AnimatedSprite"; + var material = + ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); + material.SetShaderParameter("blend", new Color(1, 1, 1, 1)); + material.SetShaderParameter("schedule", 0); + animatedSprite.Material = material; + AddChild(animatedSprite); + animatedSprite.Owner = owner; + } + else if (animatedSprite.Material == null) + { + var material = + ResourceManager.Load(ResourcePath.resource_materlal_Blend_tres, false); + material.SetShaderParameter("blend", new Color(1, 1, 1, 1)); + material.SetShaderParameter("schedule", 0); + animatedSprite.Material = material; + } + + //创建Collision + if (GetNodeOrNull("Collision") == null) + { + var co = new CollisionShape2D(); + co.Name = "Collision"; + AddChild(co); + co.Owner = owner; + } + + //创建AnimationPlayer + if (GetNodeOrNull("AnimationPlayer") == null) + { + var ap = new AnimationPlayer(); + ap.Name = "AnimationPlayer"; + AddChild(ap); + ap.Owner = owner; + } + } + } +#endif + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/common/NodeExtend.cs b/DungeonShooting_Godot/src/framework/common/NodeExtend.cs index 1b896bc..525e43a 100644 --- a/DungeonShooting_Godot/src/framework/common/NodeExtend.cs +++ b/DungeonShooting_Godot/src/framework/common/NodeExtend.cs @@ -38,4 +38,23 @@ } return null; } + + /// + /// 将节点插入的房间物体根节点 + /// + /// 实例 + /// 是否启用 YSort 排序 + public static void AddToActivityRoot(this Node2D node, bool useYSort = false) + { + if (useYSort) + { + //node.YSortEnabled = true; + GameApplication.Instance.RoomManager.YSortRoot.AddChild(node); + } + else + { + //node.YSortEnabled = false; + GameApplication.Instance.RoomManager.ObjectRoot.AddChild(node); + } + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 251402d..e9f612f 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -66,8 +66,11 @@ { //随机化种子 GD.Randomize(); + //固定帧率 + Engine.MaxFps = 60; //调试绘制开关 ActivityObject.IsDebug = Debug; + //Engine.TimeScale = 0.3f; GlobalNodeRoot = GetNode(GlobalNodeRootPath); // 初始化鼠标 diff --git a/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs index 6a52ba0..498eeb7 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs @@ -289,7 +289,7 @@ base._EnterTree(); //收集落在地上的武器 - if (Master == null && GetParent() == GameApplication.Instance.RoomManager.GetRoot()) + if (IsInGround()) { UnclaimedWeapons.Add(this); } @@ -428,6 +428,15 @@ } /// + /// 返回武器是否在地上 + /// + /// + public bool IsInGround() + { + return Master == null && GetParent() == GameApplication.Instance.RoomManager.ObjectRoot; + } + + /// /// 扳机函数, 调用即视为按下扳机 /// public void Trigger() @@ -939,9 +948,9 @@ AnimationPlayer.Play("floodlight"); } - public override void PutDown() + public override void PutDown(bool useYSort = false) { - base.PutDown(); + base.PutDown(useYSort); AnimationPlayer.Play("floodlight"); } diff --git a/DungeonShooting_Godot/src/game/item/weapon/bullet/Bullet.cs b/DungeonShooting_Godot/src/game/item/weapon/bullet/Bullet.cs index 079f4a7..0e2e218 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/bullet/Bullet.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/bullet/Bullet.cs @@ -53,7 +53,7 @@ var smoke = packedScene.Instantiate(); smoke.GlobalPosition = lastSlideCollision.GetPosition(); smoke.GlobalRotation = lastSlideCollision.GetNormal().Angle(); - GameApplication.Instance.RoomManager.GetRoot(true).AddChild(smoke); + smoke.AddToActivityRoot(true); Destroy(); return; diff --git a/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs index 057d145..78863e1 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs @@ -112,7 +112,7 @@ var sprite = packedScene.Instantiate(); sprite.GlobalPosition = FirePoint.GlobalPosition; sprite.GlobalRotation = FirePoint.GlobalRotation; - GameApplication.Instance.RoomManager.GetRoot(true).AddChild(sprite); + sprite.AddToActivityRoot(true); //播放射击音效 SoundManager.PlaySoundEffectPosition(ResourcePath.resource_sound_sfx_ordinaryBullet2_mp3, GameApplication.Instance.ViewToGlobalPosition(GlobalPosition), -8); @@ -130,6 +130,6 @@ fireRotation, GetAttackLayer() ); - bullet.PutDown(); + bullet.PutDown(true); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs b/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs index 00d205d..50f0956 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs @@ -78,7 +78,7 @@ var sprite = packedScene.Instantiate(); sprite.GlobalPosition = FirePoint.GlobalPosition; sprite.GlobalRotation = FirePoint.GlobalRotation; - GameApplication.Instance.RoomManager.GetRoot(true).AddChild(sprite); + sprite.AddToActivityRoot(true); //播放射击音效 SoundManager.PlaySoundEffectPosition(ResourcePath.resource_sound_sfx_ordinaryBullet3_mp3, GameApplication.Instance.ViewToGlobalPosition(GlobalPosition), -15); @@ -95,6 +95,6 @@ fireRotation + Utils.RandfRange(-20 / 180f * Mathf.Pi, 20 / 180f * Mathf.Pi), GetAttackLayer() ); - bullet.PutDown(); + bullet.PutDown(true); } } diff --git a/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs b/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs index 5b1b367..0c9cb5e 100644 --- a/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs +++ b/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs @@ -64,6 +64,6 @@ specialEffect.LoopCount = loopCount; specialEffect.SpriteFrames = spriteFrames; specialEffect.Play(animName); - GameApplication.Instance.RoomManager.GetRoot(true).AddChild(specialEffect); + specialEffect.AddToActivityRoot(true); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs index da6d69d..9e12343 100644 --- a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs +++ b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs @@ -6,18 +6,18 @@ /// public class AutoTileConfig { - public TileCellInfo IN_LT = new TileCellInfo(0, new Vector2(3, 3)); - public TileCellInfo IN_LB = new TileCellInfo(0, new Vector2(11, 2)); - public TileCellInfo IN_RT = new TileCellInfo(0, new Vector2(1, 3)); - public TileCellInfo IN_RB = new TileCellInfo(0, new Vector2(13, 2)); - public TileCellInfo R = new TileCellInfo(0, new Vector2(1, 3)); - public TileCellInfo L = new TileCellInfo(0, new Vector2(3, 3)); - public TileCellInfo T = new TileCellInfo(0, new Vector2(2, 7)); - public TileCellInfo B = new TileCellInfo(0, new Vector2(2, 2)); - public TileCellInfo Ground = new TileCellInfo(0, new Vector2(0, 8)); + public TileCellInfo IN_LT = new TileCellInfo(0, new Vector2I(3, 3)); + public TileCellInfo IN_LB = new TileCellInfo(0, new Vector2I(11, 2)); + public TileCellInfo IN_RT = new TileCellInfo(0, new Vector2I(1, 3)); + public TileCellInfo IN_RB = new TileCellInfo(0, new Vector2I(13, 2)); + public TileCellInfo R = new TileCellInfo(0, new Vector2I(1, 3)); + public TileCellInfo L = new TileCellInfo(0, new Vector2I(3, 3)); + public TileCellInfo T = new TileCellInfo(0, new Vector2I(2, 7)); + public TileCellInfo B = new TileCellInfo(0, new Vector2I(2, 2)); + public TileCellInfo Ground = new TileCellInfo(0, new Vector2I(0, 8)); - public TileCellInfo OUT_LT = new TileCellInfo(0, new Vector2(1, 2)); - public TileCellInfo OUT_LB = new TileCellInfo(0, new Vector2(1, 7)); - public TileCellInfo OUT_RT = new TileCellInfo(0, new Vector2(3, 2)); - public TileCellInfo OUT_RB = new TileCellInfo(0, new Vector2(3, 7)); + public TileCellInfo OUT_LT = new TileCellInfo(0, new Vector2I(1, 2)); + public TileCellInfo OUT_LB = new TileCellInfo(0, new Vector2I(1, 7)); + public TileCellInfo OUT_RT = new TileCellInfo(0, new Vector2I(3, 2)); + public TileCellInfo OUT_RB = new TileCellInfo(0, new Vector2I(3, 7)); } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/DungeonTileManager.cs b/DungeonShooting_Godot/src/game/room/DungeonTileManager.cs index 6752262..9ee392c 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonTileManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonTileManager.cs @@ -3,28 +3,30 @@ public static class DungeonTileManager { - public static void AutoFillRoomTile(TileMap floor, TileMap middle, TileMap top, AutoTileConfig config, + public static void AutoFillRoomTile(TileMap tileMap, int floorLayer, int middleLayer, int topLayer, + AutoTileConfig config, RoomInfo roomInfo) { foreach (var info in roomInfo.Next) { - AutoFillRoomTile(floor, middle, top, config, info); + AutoFillRoomTile(tileMap, floorLayer, middleLayer, topLayer, config, info); } //铺房间 - FillRect(floor, config.Ground, roomInfo.Position + Vector2.One, roomInfo.Size - new Vector2(2, 2)); + FillRect(tileMap, floorLayer, config.Ground, roomInfo.Position + Vector2.One, + roomInfo.Size - new Vector2(2, 2)); - FillRect(top, config.IN_LT, roomInfo.Position, Vector2.One); - FillRect(top, config.L, roomInfo.Position + new Vector2(0, 1), new Vector2(1, roomInfo.Size.Y - 2)); - FillRect(top, config.IN_LB, roomInfo.Position + new Vector2(0, roomInfo.Size.Y - 1), new Vector2(1, 1)); - FillRect(top, config.B, roomInfo.Position + new Vector2(1, roomInfo.Size.Y - 1), - new Vector2(roomInfo.Size.X - 2, 1)); - FillRect(top, config.IN_RB, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, roomInfo.Size.Y - 1), - Vector2.One); - FillRect(top, config.R, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 1), - new Vector2(1, roomInfo.Size.Y - 2)); - FillRect(top, config.IN_RT, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 0), Vector2.One); - FillRect(middle, config.T, roomInfo.Position + Vector2.Right, new Vector2(roomInfo.Size.X - 2, 1)); + FillRect(tileMap, topLayer, config.IN_LT, roomInfo.Position, Vector2.One); + FillRect(tileMap, topLayer, config.L, roomInfo.Position + new Vector2(0, 1), new Vector2(1, roomInfo.Size.Y - 2)); + FillRect(tileMap, topLayer, config.IN_LB, roomInfo.Position + new Vector2(0, roomInfo.Size.Y - 1), new Vector2(1, 1)); + FillRect(tileMap, topLayer, config.B, roomInfo.Position + new Vector2(1, roomInfo.Size.Y - 1), + new Vector2(roomInfo.Size.X - 2, 1)); + FillRect(tileMap, topLayer, config.IN_RB, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, roomInfo.Size.Y - 1), + Vector2.One); + FillRect(tileMap, topLayer, config.R, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 1), + new Vector2(1, roomInfo.Size.Y - 2)); + FillRect(tileMap, topLayer, config.IN_RT, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 0), Vector2.One); + FillRect(tileMap, middleLayer, config.T, roomInfo.Position + Vector2.Right, new Vector2(roomInfo.Size.X - 2, 1)); //铺过道 foreach (var doorInfo in roomInfo.Doors) @@ -56,11 +58,11 @@ if (dir == 0) //横向 { - FullHorizontalGalleryWall(floor, middle, top, config, rect); + FullHorizontalGalleryWall(tileMap, floorLayer, middleLayer, topLayer, config, rect); } else //纵向 { - FullVerticalGalleryWall(floor, middle, top, config, rect); + FullVerticalGalleryWall(tileMap, floorLayer, middleLayer, topLayer, config, rect); } } else //带交叉点 @@ -113,7 +115,7 @@ rect = new Rect2(); break; } - + switch (doorDir2) { case DoorDirection.E: //→ @@ -128,7 +130,8 @@ rect2 = new Rect2( doorInfo.Cross.X + GenerateDungeon.CorridorWidth, doorInfo.Cross.Y, - doorInfo.ConnectDoor.OriginPosition.X - (doorInfo.Cross.X + GenerateDungeon.CorridorWidth), + doorInfo.ConnectDoor.OriginPosition.X - + (doorInfo.Cross.X + GenerateDungeon.CorridorWidth), GenerateDungeon.CorridorWidth ); break; @@ -147,7 +150,8 @@ doorInfo.Cross.X, doorInfo.Cross.Y + GenerateDungeon.CorridorWidth, GenerateDungeon.CorridorWidth, - doorInfo.ConnectDoor.OriginPosition.Y - (doorInfo.Cross.Y + GenerateDungeon.CorridorWidth) + doorInfo.ConnectDoor.OriginPosition.Y - + (doorInfo.Cross.Y + GenerateDungeon.CorridorWidth) ); break; default: @@ -155,110 +159,132 @@ break; } - FillRect(floor, config.Ground, doorInfo.Cross + Vector2.One, + FillRect(tileMap, floorLayer, config.Ground, doorInfo.Cross + Vector2.One, new Vector2(GenerateDungeon.CorridorWidth - 2, GenerateDungeon.CorridorWidth - 2)); //墙壁 if (dir1 == 0) { - FullHorizontalGalleryWall(floor, middle, top, config, rect); + FullHorizontalGalleryWall(tileMap, floorLayer, middleLayer, topLayer, config, rect); } else { - FullVerticalGalleryWall(floor, middle, top, config, rect); + FullVerticalGalleryWall(tileMap, floorLayer, middleLayer, topLayer, config, rect); } + if (dir2 == 0) { - FullHorizontalGalleryWall(floor, middle, top, config, rect2); + FullHorizontalGalleryWall(tileMap, floorLayer, middleLayer, topLayer, config, rect2); } else { - FullVerticalGalleryWall(floor, middle, top, config, rect2); + FullVerticalGalleryWall(tileMap, floorLayer, middleLayer, topLayer, config, rect2); } if ((doorDir1 == DoorDirection.N && doorDir2 == DoorDirection.E) || //↑→ (doorDir2 == DoorDirection.N && doorDir1 == DoorDirection.E)) { - FillRect(top, config.OUT_RT, + FillRect(tileMap, topLayer, config.OUT_RT, doorInfo.Cross + new Vector2(0, GenerateDungeon.CorridorWidth - 1), Vector2.One); - FillRect(top, config.IN_RT, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, 0), Vector2.One); - FillRect(middle, config.T, doorInfo.Cross, new Vector2(GenerateDungeon.CorridorWidth - 1, 1)); - FillRect(top, config.R, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, 1), + FillRect(tileMap, topLayer, config.IN_RT, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, 0), + Vector2.One); + FillRect(tileMap, middleLayer, config.T, doorInfo.Cross, new Vector2(GenerateDungeon.CorridorWidth - 1, 1)); + FillRect(tileMap, topLayer, config.R, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, 1), new Vector2(1, GenerateDungeon.CorridorWidth - 1)); } else if ((doorDir1 == DoorDirection.E && doorDir2 == DoorDirection.S) || //→↓ (doorDir2 == DoorDirection.E && doorDir1 == DoorDirection.S)) { - FillRect(middle, config.OUT_RB, doorInfo.Cross, Vector2.One); - FillRect(top, config.IN_RB, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, GenerateDungeon.CorridorWidth - 1), + FillRect(tileMap, middleLayer, config.OUT_RB, doorInfo.Cross, Vector2.One); + FillRect(tileMap, topLayer, config.IN_RB, + doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, + GenerateDungeon.CorridorWidth - 1), Vector2.One); - FillRect(top, config.R, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, 0), + FillRect(tileMap, topLayer, config.R, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, 0), new Vector2(1, GenerateDungeon.CorridorWidth - 1)); - FillRect(top, config.B, doorInfo.Cross + new Vector2(0, GenerateDungeon.CorridorWidth - 1), + FillRect(tileMap, topLayer, config.B, doorInfo.Cross + new Vector2(0, GenerateDungeon.CorridorWidth - 1), new Vector2(GenerateDungeon.CorridorWidth - 1, 1)); } else if ((doorDir1 == DoorDirection.S && doorDir2 == DoorDirection.W) || //↓← (doorDir2 == DoorDirection.S && doorDir1 == DoorDirection.W)) { - FillRect(middle, config.OUT_LB, + FillRect(tileMap, middleLayer, config.OUT_LB, doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, 0), Vector2.One); - FillRect(top, config.IN_LB, doorInfo.Cross + new Vector2(0, GenerateDungeon.CorridorWidth - 1), + FillRect(tileMap, topLayer, config.IN_LB, doorInfo.Cross + new Vector2(0, GenerateDungeon.CorridorWidth - 1), Vector2.One); - FillRect(top, config.L, doorInfo.Cross, new Vector2(1, GenerateDungeon.CorridorWidth - 1)); - FillRect(top, config.B, doorInfo.Cross + new Vector2(1, GenerateDungeon.CorridorWidth - 1), + FillRect(tileMap, topLayer, config.L, doorInfo.Cross, new Vector2(1, GenerateDungeon.CorridorWidth - 1)); + FillRect(tileMap, topLayer, config.B, doorInfo.Cross + new Vector2(1, GenerateDungeon.CorridorWidth - 1), new Vector2(GenerateDungeon.CorridorWidth - 1, 1)); } else if ((doorDir1 == DoorDirection.W && doorDir2 == DoorDirection.N) || //←↑ (doorDir2 == DoorDirection.W && doorDir1 == DoorDirection.N)) { - FillRect(top, config.OUT_LT, - doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, GenerateDungeon.CorridorWidth - 1), + FillRect(tileMap, topLayer, config.OUT_LT, + doorInfo.Cross + new Vector2(GenerateDungeon.CorridorWidth - 1, + GenerateDungeon.CorridorWidth - 1), Vector2.One); - FillRect(top, config.IN_LT, doorInfo.Cross, Vector2.One); - FillRect(middle, config.T, doorInfo.Cross + new Vector2(1, 0), + FillRect(tileMap, topLayer, config.IN_LT, doorInfo.Cross, Vector2.One); + FillRect(tileMap, middleLayer, config.T, doorInfo.Cross + new Vector2(1, 0), new Vector2(GenerateDungeon.CorridorWidth - 1, 1)); - FillRect(top, config.L, doorInfo.Cross + new Vector2(0, 1), + FillRect(tileMap, topLayer, config.L, doorInfo.Cross + new Vector2(0, 1), new Vector2(1, GenerateDungeon.CorridorWidth - 1)); } - + //在房间墙上开洞 switch (doorDir1) { case DoorDirection.E: //→ - ClearRect(top, doorInfo.OriginPosition + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); - FillRect(floor, config.Ground, doorInfo.OriginPosition + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); + ClearRect(tileMap, topLayer, doorInfo.OriginPosition + new Vector2(-1, 1), + new Vector2(1, rect.Size.Y - 2)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.OriginPosition + new Vector2(-1, 1), + new Vector2(1, rect.Size.Y - 2)); break; case DoorDirection.W: //← - ClearRect(top, doorInfo.OriginPosition + new Vector2(0, 1), new Vector2(1, rect.Size.Y - 2)); - FillRect(floor, config.Ground, doorInfo.OriginPosition + new Vector2(0, 1), new Vector2(1, rect.Size.Y - 2)); + ClearRect(tileMap, topLayer, doorInfo.OriginPosition + new Vector2(0, 1), + new Vector2(1, rect.Size.Y - 2)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.OriginPosition + new Vector2(0, 1), + new Vector2(1, rect.Size.Y - 2)); break; case DoorDirection.S: //↓ - ClearRect(top, doorInfo.OriginPosition + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); - FillRect(floor, config.Ground, doorInfo.OriginPosition + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); + ClearRect(tileMap, topLayer, doorInfo.OriginPosition + new Vector2(1, -1), + new Vector2(rect.Size.X - 2, 1)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.OriginPosition + new Vector2(1, -1), + new Vector2(rect.Size.X - 2, 1)); break; case DoorDirection.N: //↑ - ClearRect(middle, doorInfo.OriginPosition + new Vector2(1, 2), new Vector2(rect.Size.X - 2, 1)); - FillRect(floor, config.Ground, doorInfo.OriginPosition + new Vector2(1, 0), new Vector2(rect.Size.X - 2, 1)); + ClearRect(tileMap, middleLayer, doorInfo.OriginPosition + new Vector2(1, 2), + new Vector2(rect.Size.X - 2, 1)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.OriginPosition + new Vector2(1, 0), + new Vector2(rect.Size.X - 2, 1)); break; } + switch (doorDir2) { case DoorDirection.E: //→ - ClearRect(top, doorInfo.ConnectDoor.OriginPosition + new Vector2(-1, 1), new Vector2(1, rect2.Size.Y - 2)); - FillRect(floor, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(-1, 1), new Vector2(1, rect2.Size.Y - 2)); + ClearRect(tileMap, topLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(-1, 1), + new Vector2(1, rect2.Size.Y - 2)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(-1, 1), + new Vector2(1, rect2.Size.Y - 2)); break; case DoorDirection.W: //← - ClearRect(top, doorInfo.ConnectDoor.OriginPosition + new Vector2(0, 1), new Vector2(1, rect2.Size.Y - 2)); - FillRect(floor, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(0, 1), new Vector2(1, rect2.Size.Y - 2)); + ClearRect(tileMap, topLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(0, 1), + new Vector2(1, rect2.Size.Y - 2)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(0, 1), + new Vector2(1, rect2.Size.Y - 2)); break; case DoorDirection.S: //↓ - ClearRect(top, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, -1), new Vector2(rect2.Size.X - 2, 1)); - FillRect(floor, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, -1), new Vector2(rect2.Size.X - 2, 1)); + ClearRect(tileMap, topLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, -1), + new Vector2(rect2.Size.X - 2, 1)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, -1), + new Vector2(rect2.Size.X - 2, 1)); break; case DoorDirection.N: //↑ - ClearRect(middle, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, 0), new Vector2(rect2.Size.X - 2, 1)); - FillRect(floor, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, 0), new Vector2(rect2.Size.X - 2, 1)); + ClearRect(tileMap, middleLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, 0), + new Vector2(rect2.Size.X - 2, 1)); + FillRect(tileMap, floorLayer, config.Ground, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, 0), + new Vector2(rect2.Size.X - 2, 1)); break; } } @@ -266,52 +292,57 @@ } } - private static void FillRect(TileMap tileMap, TileCellInfo info, Vector2 pos, Vector2 size) + private static void FillRect(TileMap tileMap, int layer, TileCellInfo info, Vector2 pos, Vector2 size) { for (int i = 0; i < size.X; i++) { for (int j = 0; j < size.Y; j++) { //tileMap.SetCell((int)pos.X + i, (int)pos.Y + j, info.Id, false, false, false, info.AutotileCoord); + tileMap.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), 1, info.AutotileCoord); + //tileMap.SetCell(layer, new Vector2I(0, 0), 1, new Vector2I(0, 8), 0); } } } - private static void ClearRect(TileMap tileMap, Vector2 pos, Vector2 size) + private static void ClearRect(TileMap tileMap, int layer, Vector2 pos, Vector2 size) { for (int i = 0; i < size.X; i++) { for (int j = 0; j < size.Y; j++) { //tileMap.SetCell((int)pos.X + i, (int)pos.Y + j, -1); + tileMap.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), -1); } } } - private static void FullHorizontalGalleryWall(TileMap floor, TileMap middle, TileMap top, AutoTileConfig config, Rect2 rect) + private static void FullHorizontalGalleryWall(TileMap tileMap, int floorLayer, int middleLayer, int topLayer, + AutoTileConfig config, Rect2 rect) { - FillRect(floor, config.Ground, rect.Position + new Vector2(0, 1), rect.Size - new Vector2(0, 2)); - FillRect(middle, config.T, rect.Position, new Vector2(rect.Size.X, 1)); - FillRect(top, config.B, rect.Position + new Vector2(0, rect.Size.Y - 1), new Vector2(rect.Size.X, 1)); + FillRect(tileMap, floorLayer, config.Ground, rect.Position + new Vector2(0, 1), rect.Size - new Vector2(0, 2)); + FillRect(tileMap, middleLayer, config.T, rect.Position, new Vector2(rect.Size.X, 1)); + FillRect(tileMap, topLayer, config.B, rect.Position + new Vector2(0, rect.Size.Y - 1), new Vector2(rect.Size.X, 1)); //左 - ClearRect(top, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); - FillRect(floor, config.Ground, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); + ClearRect(tileMap, topLayer, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); + FillRect(tileMap, floorLayer, config.Ground, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); //右 - ClearRect(top, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); - FillRect(floor, config.Ground, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); + ClearRect(tileMap, topLayer, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); + FillRect(tileMap, floorLayer, config.Ground, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); } - private static void FullVerticalGalleryWall(TileMap floor, TileMap middle, TileMap top, AutoTileConfig config, Rect2 rect) + private static void FullVerticalGalleryWall(TileMap tileMap, int floorLayer, int middleLayer, int topLayer, + AutoTileConfig config, Rect2 rect) { - FillRect(floor, config.Ground, rect.Position + new Vector2(1, 0), rect.Size - new Vector2(2, 0)); - FillRect(top, config.L, rect.Position, new Vector2(1, rect.Size.Y)); - FillRect(top, config.R, rect.Position + new Vector2(rect.Size.X - 1, 0), new Vector2(1, rect.Size.Y)); + FillRect(tileMap, floorLayer, config.Ground, rect.Position + new Vector2(1, 0), rect.Size - new Vector2(2, 0)); + FillRect(tileMap, topLayer, config.L, rect.Position, new Vector2(1, rect.Size.Y)); + FillRect(tileMap, topLayer, config.R, rect.Position + new Vector2(rect.Size.X - 1, 0), new Vector2(1, rect.Size.Y)); //上 - ClearRect(top, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); - FillRect(floor, config.Ground, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); + ClearRect(tileMap, topLayer, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); + FillRect(tileMap, floorLayer, config.Ground, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); //下 - ClearRect(middle, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); - FillRect(floor, config.Ground, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); + ClearRect(tileMap, middleLayer, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); + FillRect(tileMap, floorLayer, config.Ground, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/RoomLayerEnum.cs b/DungeonShooting_Godot/src/game/room/RoomLayerEnum.cs new file mode 100644 index 0000000..c5a3996 --- /dev/null +++ b/DungeonShooting_Godot/src/game/room/RoomLayerEnum.cs @@ -0,0 +1,15 @@ + +/// +/// 房间物体放置层级枚举 +/// +public enum RoomLayerEnum +{ + /// + /// 按照插入顺序依次绘制 + /// + NormalLayer, + /// + /// 按照Y轴排序绘制 + /// + YSortLayer +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/RoomManager.cs b/DungeonShooting_Godot/src/game/room/RoomManager.cs index 075ec91..f4ca489 100644 --- a/DungeonShooting_Godot/src/game/room/RoomManager.cs +++ b/DungeonShooting_Godot/src/game/room/RoomManager.cs @@ -8,6 +8,10 @@ /// public partial class RoomManager : Node2D { + public const int FloorMapLayer = 0; + public const int MiddleMapLayer = 1; + public const int TopMapLayer = 2; + /// /// //对象根节点 /// @@ -61,7 +65,7 @@ Player = new Player(); Player.Position = new Vector2(100, 100); Player.Name = "Player"; - Player.PutDown(); + Player.PutDown(true); } public override void _Ready() @@ -77,16 +81,13 @@ //填充地牢 _autoTileConfig = new AutoTileConfig(); - //DungeonTileManager.AutoFillRoomTile(FloorTileMap, MiddleTileMap, TopTileMap, _autoTileConfig, _generateDungeon.StartRoom); - // FloorTileMap.UpdateDirtyQuadrants(); - // MiddleTileMap.UpdateDirtyQuadrants(); - // TopTileMap.UpdateDirtyQuadrants(); + DungeonTileManager.AutoFillRoomTile(TileRoot, FloorMapLayer, MiddleMapLayer, TopMapLayer, _autoTileConfig, _generateDungeon.StartRoom); //根据房间数据创建填充 tiled var nowTicks = DateTime.Now.Ticks; //生成寻路网格 - //GenerateNavigationPolygon(); + GenerateNavigationPolygon(); var polygon = new NavigationPolygon(); foreach (var polygonData in _polygonDataList) { @@ -98,10 +99,10 @@ //播放bgm SoundManager.PlayMusic(ResourcePath.resource_sound_bgm_Intro_ogg, -17f); - + var enemy1 = new Enemy(); enemy1.Name = "Enemy"; - enemy1.PutDown(new Vector2(150, 300)); + enemy1.PutDown(new Vector2(100, 100)); enemy1.PickUpWeapon(WeaponManager.GetGun("1003")); enemy1.PickUpWeapon(WeaponManager.GetGun("1001")); @@ -114,18 +115,18 @@ // enemyTemp.PickUpWeapon(WeaponManager.GetGun("1001")); // } - // var enemy2 = new Enemy(); - // enemy2.Name = "Enemy2"; - // enemy2.PutDown(new Vector2(540, 100)); - // enemy2.PickUpWeapon(WeaponManager.GetGun("1002")); - // //enemy2.PickUpWeapon(WeaponManager.GetGun("1004")); - // //enemy2.PickUpWeapon(WeaponManager.GetGun("1003")); - // - // var enemy3 = new Enemy(); - // enemy3.Name = "Enemy3"; - // enemy3.PutDown(new Vector2(540, 300)); - // enemy3.PickUpWeapon(WeaponManager.GetGun("1003")); - // enemy3.PickUpWeapon(WeaponManager.GetGun("1002")); + var enemy2 = new Enemy(); + enemy2.Name = "Enemy2"; + enemy2.PutDown(new Vector2(120, 100)); + enemy2.PickUpWeapon(WeaponManager.GetGun("1002")); + //enemy2.PickUpWeapon(WeaponManager.GetGun("1004")); + //enemy2.PickUpWeapon(WeaponManager.GetGun("1003")); + + var enemy3 = new Enemy(); + enemy3.Name = "Enemy3"; + enemy3.PutDown(new Vector2(100, 120)); + enemy3.PickUpWeapon(WeaponManager.GetGun("1003")); + enemy3.PickUpWeapon(WeaponManager.GetGun("1002")); WeaponManager.GetGun("1004").PutDown(new Vector2(80, 100)); WeaponManager.GetGun("1001").PutDown(new Vector2(220, 120)); @@ -167,22 +168,11 @@ } /// - /// 获取房间根节点 - /// - /// 是否获取 Node2D 节点 - /// - public Node2D GetRoot(bool useYSort = false) - { - return useYSort ? YSortRoot : ObjectRoot; - } - - /// /// 返回指定位置的Tile是否为可以行走 /// public bool IsWayTile(int x, int y) { - return false; - //return FloorTileMap.GetCell(x, y) != TileMap.InvalidCell; + return TileRoot.GetCellTileData(FloorMapLayer, new Vector2I(x, y)) != null; } /// diff --git a/DungeonShooting_Godot/src/game/room/TileCellInfo.cs b/DungeonShooting_Godot/src/game/room/TileCellInfo.cs index 355ebff..ad2fcb3 100644 --- a/DungeonShooting_Godot/src/game/room/TileCellInfo.cs +++ b/DungeonShooting_Godot/src/game/room/TileCellInfo.cs @@ -6,7 +6,7 @@ /// public class TileCellInfo { - public TileCellInfo(int id, Vector2? autotileCoord) + public TileCellInfo(int id, Vector2I? autotileCoord) { Id = id; AutotileCoord = autotileCoord; @@ -20,5 +20,5 @@ /// /// 如果是图块集, 该属性就表示在图块集的位置 /// - public Vector2? AutotileCoord; + public Vector2I? AutotileCoord; } \ No newline at end of file