diff --git a/DungeonShooting_Godot/prefab/role/Role0001.tscn b/DungeonShooting_Godot/prefab/role/Role0001.tscn index a541d06..4aa6161 100644 --- a/DungeonShooting_Godot/prefab/role/Role0001.tscn +++ b/DungeonShooting_Godot/prefab/role/Role0001.tscn @@ -58,6 +58,7 @@ [node name="AnimatedSprite" parent="." index="2"] material = SubResource("ShaderMaterial_8hgu2") sprite_frames = ExtResource("4_galcc") +animation = &"roll" [node name="HurtCollision" parent="HurtArea" index="0"] shape = SubResource("RectangleShape2D_ve262") diff --git a/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn b/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn index 7b22ce1..ee3962d 100644 --- a/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn +++ b/DungeonShooting_Godot/prefab/weapon/WeaponTemplate.tscn @@ -12,6 +12,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true +shader_parameter/grey = 0.0 [sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] resource_local_to_scene = true @@ -23,6 +24,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true +shader_parameter/grey = 0.0 [sub_resource type="Animation" id="Animation_x136i"] length = 0.001 @@ -36,10 +38,10 @@ "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [0] +"values": [0.0] } -[sub_resource type="Animation" id="Animation_3piau"] +[sub_resource type="Animation" id="Animation_1y7bx"] resource_name = "floodlight" length = 3.0 loop_mode = 1 @@ -53,13 +55,13 @@ "times": PackedFloat32Array(0, 2.3, 2.6, 2.7, 3), "transitions": PackedFloat32Array(1, 1, 1, 1, 1), "update": 0, -"values": [0, 0, 0.5, 0.5, 0] +"values": [0.0, 0.0, 0.8, 0.8, 0.0] } [sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"] _data = { "RESET": SubResource("Animation_x136i"), -"floodlight": SubResource("Animation_3piau") +"floodlight": SubResource("Animation_1y7bx") } [node name="WeaponTemplate" type="CharacterBody2D"] diff --git a/DungeonShooting_Godot/resource/material/Blend.gdshader b/DungeonShooting_Godot/resource/material/Blend.gdshader index bbd35e5..2fd8b76 100644 --- a/DungeonShooting_Godot/resource/material/Blend.gdshader +++ b/DungeonShooting_Godot/resource/material/Blend.gdshader @@ -3,7 +3,7 @@ //混合颜色 uniform vec4 blend : source_color = vec4(1.0, 1.0, 1.0, 1.0); //混合度 -uniform float schedule : hint_range(0.0, 1.0) = 0.0; +uniform float schedule : hint_range(0.0, 1.0, 0.01) = 0.0; // uniform vec4 modulate : source_color = vec4(1.0, 1.0, 1.0, 1.0); diff --git a/DungeonShooting_Godot/resource/material/Blend.tres b/DungeonShooting_Godot/resource/material/Blend.tres index b3015f1..707d8fa 100644 --- a/DungeonShooting_Godot/resource/material/Blend.tres +++ b/DungeonShooting_Godot/resource/material/Blend.tres @@ -12,3 +12,4 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true +shader_parameter/grey = 0.0 diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0008.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0008.png index 462e9a3..cea4550 100644 --- a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0008.png +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0008.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0009.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0009.png index 7508707..e1bac27 100644 --- a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0009.png +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0009.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0010.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0010.png new file mode 100644 index 0000000..a9e5690 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0010.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0010.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0010.png.import new file mode 100644 index 0000000..6482347 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0010.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://do6ybmo0r04pp" +path="res://.godot/imported/Sprite-0010.png-c80699f0403ae66453b70f57a31ecc59.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/roll/Sprite-0010.png" +dest_files=["res://.godot/imported/Sprite-0010.png-c80699f0403ae66453b70f57a31ecc59.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/resource/sprite/role/role0001/roll/Sprite-0011.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0011.png new file mode 100644 index 0000000..f63d0c0 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0011.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0011.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0011.png.import new file mode 100644 index 0000000..e95d2b4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0011.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b3itgraiw7mns" +path="res://.godot/imported/Sprite-0011.png-f39da561788471562fea5b85fccb8f15.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/roll/Sprite-0011.png" +dest_files=["res://.godot/imported/Sprite-0011.png-f39da561788471562fea5b85fccb8f15.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/resource/sprite/role/role0001/roll/Sprite-0012.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0012.png new file mode 100644 index 0000000..7b5dcb4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0012.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0012.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0012.png.import new file mode 100644 index 0000000..a19b1ed --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0012.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cisayo3amq6sv" +path="res://.godot/imported/Sprite-0012.png-838a44169d52507787688a04449f37cc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/roll/Sprite-0012.png" +dest_files=["res://.godot/imported/Sprite-0012.png-838a44169d52507787688a04449f37cc.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/resource/sprite/role/role0001/roll/Sprite-0013.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0013.png new file mode 100644 index 0000000..80f40dd --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0013.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0013.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0013.png.import new file mode 100644 index 0000000..954145b --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0013.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dtndan40ql7ou" +path="res://.godot/imported/Sprite-0013.png-cbdb81418692a4dd25c46861cf67e34f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/roll/Sprite-0013.png" +dest_files=["res://.godot/imported/Sprite-0013.png-cbdb81418692a4dd25c46861cf67e34f.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/resource/sprite/role/role0001/roll/Sprite-0014.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0014.png new file mode 100644 index 0000000..8c8b1e5 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0014.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0014.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0014.png.import new file mode 100644 index 0000000..b80afa8 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0014.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dj30rfk3rndmm" +path="res://.godot/imported/Sprite-0014.png-56b06536a4dd9976774a8e1b4a6c7634.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/roll/Sprite-0014.png" +dest_files=["res://.godot/imported/Sprite-0014.png-56b06536a4dd9976774a8e1b4a6c7634.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/resource/sprite/role/role0001/roll/Sprite-0015.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0015.png new file mode 100644 index 0000000..3496c24 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0015.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0015.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0015.png.import new file mode 100644 index 0000000..8a4784c --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0015.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://vs7ip3v274e2" +path="res://.godot/imported/Sprite-0015.png-582239a5457ef5c714a94f9ac0d9732d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/roll/Sprite-0015.png" +dest_files=["res://.godot/imported/Sprite-0015.png-582239a5457ef5c714a94f9ac0d9732d.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/resource/sprite/role/role0001/roll/Sprite-0016.png b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0016.png new file mode 100644 index 0000000..615dd45 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0016.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0016.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0016.png.import new file mode 100644 index 0000000..b352eca --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/roll/Sprite-0016.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7yrbkcy1g56a" +path="res://.godot/imported/Sprite-0016.png-c52581d1493a9b1c102d236e75a367e5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/roll/Sprite-0016.png" +dest_files=["res://.godot/imported/Sprite-0016.png-c52581d1493a9b1c102d236e75a367e5.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/resource/spriteFrames/role/Role0001.tres b/DungeonShooting_Godot/resource/spriteFrames/role/Role0001.tres index 481275b..7c23698 100644 --- a/DungeonShooting_Godot/resource/spriteFrames/role/Role0001.tres +++ b/DungeonShooting_Godot/resource/spriteFrames/role/Role0001.tres @@ -1,4 +1,4 @@ -[gd_resource type="SpriteFrames" load_steps=17 format=3 uid="uid://n11thtali6es"] +[gd_resource type="SpriteFrames" load_steps=24 format=3 uid="uid://n11thtali6es"] [ext_resource type="Texture2D" uid="uid://ekas4lqprrml" path="res://resource/sprite/role/role0001/idle/Sprite-0002.png" id="1_le6bk"] [ext_resource type="Texture2D" uid="uid://b81k08ofpf2oo" path="res://resource/sprite/role/role0001/idle/Sprite-0003.png" id="2_whsc2"] @@ -14,8 +14,15 @@ [ext_resource type="Texture2D" uid="uid://d32g0f5vk68sj" path="res://resource/sprite/role/role0001/run/Sprite-0004.png" id="12_cbabh"] [ext_resource type="Texture2D" uid="uid://cw83liyy6gnln" path="res://resource/sprite/role/role0001/run/Sprite-0003.png" id="13_u0cmp"] [ext_resource type="Texture2D" uid="uid://b1gh481w2xvsl" path="res://resource/sprite/role/role0001/run/Sprite-0002.png" id="14_nlfq5"] +[ext_resource type="Texture2D" uid="uid://do6ybmo0r04pp" path="res://resource/sprite/role/role0001/roll/Sprite-0010.png" id="17_e31g7"] +[ext_resource type="Texture2D" uid="uid://b3itgraiw7mns" path="res://resource/sprite/role/role0001/roll/Sprite-0011.png" id="18_g0o3y"] +[ext_resource type="Texture2D" uid="uid://cisayo3amq6sv" path="res://resource/sprite/role/role0001/roll/Sprite-0012.png" id="19_s6xfs"] +[ext_resource type="Texture2D" uid="uid://dtndan40ql7ou" path="res://resource/sprite/role/role0001/roll/Sprite-0013.png" id="20_rclf1"] +[ext_resource type="Texture2D" uid="uid://dj30rfk3rndmm" path="res://resource/sprite/role/role0001/roll/Sprite-0014.png" id="21_eyvqg"] [ext_resource type="Texture2D" uid="uid://b2hdk7nca5rda" path="res://resource/sprite/role/role0001/roll/Sprite-0008.png" id="21_oocqa"] +[ext_resource type="Texture2D" uid="uid://vs7ip3v274e2" path="res://resource/sprite/role/role0001/roll/Sprite-0015.png" id="22_aoq4g"] [ext_resource type="Texture2D" uid="uid://bmoh16y1r2h1w" path="res://resource/sprite/role/role0001/roll/Sprite-0009.png" id="22_yc5ek"] +[ext_resource type="Texture2D" uid="uid://b7yrbkcy1g56a" path="res://resource/sprite/role/role0001/roll/Sprite-0016.png" id="23_8xesy"] [resource] animations = [{ @@ -85,10 +92,31 @@ }, { "duration": 1.0, "texture": ExtResource("22_yc5ek") +}, { +"duration": 1.0, +"texture": ExtResource("17_e31g7") +}, { +"duration": 1.0, +"texture": ExtResource("18_g0o3y") +}, { +"duration": 1.0, +"texture": ExtResource("19_s6xfs") +}, { +"duration": 1.0, +"texture": ExtResource("20_rclf1") +}, { +"duration": 1.0, +"texture": ExtResource("21_eyvqg") +}, { +"duration": 1.0, +"texture": ExtResource("22_aoq4g") +}, { +"duration": 1.0, +"texture": ExtResource("23_8xesy") }], "loop": false, "name": &"roll", -"speed": 15.0 +"speed": 18.0 }, { "frames": [{ "duration": 1.0, diff --git a/DungeonShooting_Godot/src/game/activity/role/player/Player.cs b/DungeonShooting_Godot/src/game/activity/role/player/Player.cs index d906c99..944c3ed 100644 --- a/DungeonShooting_Godot/src/game/activity/role/player/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/player/Player.cs @@ -106,20 +106,20 @@ _rollCoolingTimer -= delta; } - //脸的朝向 - var gPos = Position; - Vector2 mousePos = InputManager.CursorPosition; - if (mousePos.X > gPos.X && Face == FaceDirection.Left) + if (MountLookTarget) //看向目标 { - Face = FaceDirection.Right; - } - else if (mousePos.X < gPos.X && Face == FaceDirection.Right) - { - Face = FaceDirection.Left; - } - - if (MountLookTarget) - { + //脸的朝向 + var gPos = Position; + Vector2 mousePos = InputManager.CursorPosition; + if (mousePos.X > gPos.X && Face == FaceDirection.Left) + { + Face = FaceDirection.Right; + } + else if (mousePos.X < gPos.X && Face == FaceDirection.Right) + { + Face = FaceDirection.Left; + } + //枪口跟随鼠标 MountPoint.SetLookAt(mousePos); } diff --git a/DungeonShooting_Godot/src/game/activity/role/player/PlayerRoleState.cs b/DungeonShooting_Godot/src/game/activity/role/player/PlayerRoleState.cs index a276605..f0123c5 100644 --- a/DungeonShooting_Godot/src/game/activity/role/player/PlayerRoleState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/player/PlayerRoleState.cs @@ -4,7 +4,7 @@ /// /// 翻滚速度 /// - public float RollSpeed = 400f; + public float RollSpeed = 200f; /// /// 翻滚持续时间 diff --git a/DungeonShooting_Godot/src/game/activity/role/player/state/PlayerRollState.cs b/DungeonShooting_Godot/src/game/activity/role/player/state/PlayerRollState.cs index f108c44..8af732a 100644 --- a/DungeonShooting_Godot/src/game/activity/role/player/state/PlayerRollState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/player/state/PlayerRollState.cs @@ -23,9 +23,9 @@ _coroutineId = Master.StartCoroutine(RunRoll()); - // //隐藏武器 - // Master.BackMountPoint.Visible = false; - // Master.MountPoint.Visible = false; + //隐藏武器 + Master.BackMountPoint.Visible = false; + Master.MountPoint.Visible = false; //禁用伤害碰撞 Master.HurtCollision.Disabled = true; @@ -36,9 +36,9 @@ public override void Exit(PlayerStateEnum next) { - // //显示武器 - // Master.BackMountPoint.Visible = true; - // Master.MountPoint.Visible = true; + //显示武器 + Master.BackMountPoint.Visible = true; + Master.MountPoint.Visible = true; //启用伤害碰撞 Master.HurtCollision.Disabled = false; Master.BasisVelocity = Master.BasisVelocity.LimitLength(Master.RoleState.MoveSpeed); @@ -52,30 +52,25 @@ //翻滚逻辑处理 private IEnumerator RunRoll() { - Master.AnimationPlayer.Play(AnimatorNames.Roll); - var time = 0f; - var time2 = 0f; - while (time < Master.PlayerRoleState.RollTime) - { - var delta = (float)Master.GetProcessDeltaTime(); - time += delta; - time2 += delta; - if (time2 >= 0.02f) - { - time2 %= 0.02f; - //拖尾效果 - var staticSprite = ObjectManager.GetPoolItemByClass(); - staticSprite.FromActivityObject(Master); - staticSprite.SetShowTimeout(0.2f); - staticSprite.ZIndex = 1; - var roomLayer = Master.World.GetRoomLayer(RoomLayerEnum.NormalLayer); - roomLayer.AddChild(staticSprite); - //roomLayer.MoveChild(staticSprite, Master.GetIndex()); - } + Master.AnimatedSprite.Play(AnimatorNames.Roll); - yield return null; + Master.MountLookTarget = false; + var face = Master.Face; + var velocity = Master.BasisVelocity; + if (velocity.X > 0 && face == FaceDirection.Left) + { + Master.Face = FaceDirection.Right; } + else if (velocity.X < 0 && face == FaceDirection.Right) + { + Master.Face = FaceDirection.Left; + } + + yield return Master.AnimatedSprite.ToSignal(Master.AnimatedSprite, AnimatedSprite2D.SignalName.AnimationFinished); _coroutineId = -1; + + Master.MountLookTarget = true; + Master.Face = face; Master.OverRoll(); if (InputManager.MoveAxis != Vector2.Zero) //切换到移动状态 {