diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs index f53cac1..9e54ad1 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs @@ -502,10 +502,15 @@ public void Throw(float altitude, float verticalSpeed, Vector2 velocity, float rotate) { var parent = GetParent(); - if (parent == null || parent != GameApplication.Instance.RoomManager.YSortLayer) + if (parent == null) { GameApplication.Instance.RoomManager.YSortLayer.AddChild(this); } + else if (parent != GameApplication.Instance.RoomManager.YSortLayer) + { + parent.RemoveChild(this); + GameApplication.Instance.RoomManager.YSortLayer.AddChild(this); + } Altitude = altitude; VerticalSpeed = verticalSpeed; @@ -659,7 +664,6 @@ else { GlobalRotationDegrees = GlobalRotationDegrees + ThrowRotationDegreesSpeed * newDelta; - CalcThrowAnimatedPosition(); var ysp = VerticalSpeed; @@ -728,6 +732,8 @@ ThrowOver(); } } + //计算精灵位置 + CalcThrowAnimatedPosition(); } } @@ -929,16 +935,9 @@ ShadowSprite.Rotation = 0; //阴影位置计算 var pos = AnimatedSprite.GlobalPosition; - if (_fallData != null && !_isFallOver) - { - ShadowSprite.GlobalPosition = new Vector2(pos.X + ShadowOffset.X, pos.Y + ShadowOffset.Y + Altitude); - } - else - { - ShadowSprite.GlobalPosition = pos + ShadowOffset; - } + ShadowSprite.GlobalPosition = new Vector2(pos.X + ShadowOffset.X, pos.Y + ShadowOffset.Y + Altitude); } - + //计算位置 private void CalcThrowAnimatedPosition() { diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 183c2bf..d6b0007 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -65,7 +65,7 @@ Engine.MaxFps = 60; //调试绘制开关 ActivityObject.IsDebug = Debug; - //Engine.TimeScale = 0.3f; + //Engine.TimeScale = 0.2f; //初始化ui UiManager.Init(); diff --git a/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs b/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs index 0d9b41c..8a5ecc1 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/WeaponAttribute.cs @@ -79,7 +79,7 @@ /// public float StartFiringSpeed = 300; /// - /// 最终射速, 最终每分钟能开火次数 + /// 最终射速, 最终每分钟能开火次数, 仅当 ContinuousShoot 为 true 时生效 /// public float FinalFiringSpeed = 300; /// diff --git a/DungeonShooting_Godot/src/game/room/RoomManager.cs b/DungeonShooting_Godot/src/game/room/RoomManager.cs index fa9b674..5e26ca9 100644 --- a/DungeonShooting_Godot/src/game/room/RoomManager.cs +++ b/DungeonShooting_Godot/src/game/room/RoomManager.cs @@ -94,10 +94,6 @@ Player.PickUpWeapon(ActivityObject.Create(ActivityIdPrefix.Weapon + "0001")); - var weapon = ActivityObject.Create(ActivityIdPrefix.Weapon + "0001"); - weapon.PutDown(RoomLayerEnum.NormalLayer); - weapon.Altitude = 32; - // for (int i = 0; i < 10; i++) // { // var enemy = ActivityObject.Create(ActivityIdPrefix.Enemy + "0001"); diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/GunBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/GunBar.cs index 4022dd2..cfd1f34 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/GunBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/GunBar.cs @@ -27,7 +27,7 @@ public void Process(float delta) { - var weapon = Player.Current.Holster.ActiveWeapon; + var weapon = Player.Current?.Holster.ActiveWeapon; if (weapon != null) { SetWeaponAmmunition(weapon.CurrAmmo, weapon.ResidueAmmo);