diff --git a/DungeonShooting_Godot/src/game/role/Player.cs b/DungeonShooting_Godot/src/game/role/Player.cs index ae777c2..0946c07 100644 --- a/DungeonShooting_Godot/src/game/role/Player.cs +++ b/DungeonShooting_Godot/src/game/role/Player.cs @@ -1,4 +1,3 @@ -using System.Collections; using Godot; diff --git a/DungeonShooting_Godot/src/game/role/Role.cs b/DungeonShooting_Godot/src/game/role/Role.cs index 51d98f0..1d4ba68 100644 --- a/DungeonShooting_Godot/src/game/role/Role.cs +++ b/DungeonShooting_Godot/src/game/role/Role.cs @@ -297,58 +297,25 @@ /// 放入武器袋的位置 public virtual void OnPutBackMount(Weapon weapon, int index) { - if (index == 0) + if (index < 8) { - weapon.Position = new Vector2(0, 5); - weapon.RotationDegrees = 50; - weapon.Scale = new Vector2(-1, 1); - } - else if (index == 1) - { - weapon.Position = new Vector2(0, 0); - weapon.RotationDegrees = 120; - weapon.Scale = new Vector2(1, -1); - } - else if (index == 2) - { - weapon.Position = new Vector2(0, 5); - weapon.RotationDegrees = 310; - weapon.Scale = new Vector2(1, 1); - } - else if (index == 3) - { - weapon.Position = new Vector2(0, 0); - weapon.RotationDegrees = 60; - weapon.Scale = new Vector2(1, 1); + if (index % 2 == 0) + { + weapon.Position = new Vector2(-4, 5); + weapon.RotationDegrees = 90 - (index / 2f) * 20; + weapon.Scale = new Vector2(-1, 1); + } + else + { + weapon.Position = new Vector2(4, 5); + weapon.RotationDegrees = 270 + (index - 1) / 2f * 20; + weapon.Scale = new Vector2(1, 1); + } } else { weapon.Visible = false; } - // if (index == 0) - // { - // weapon.Position = new Vector2(0, 5); - // weapon.RotationDegrees = 50; - // weapon.Scale = new Vector2(-1, 1); - // } - // else if (index == 1) - // { - // weapon.Position = new Vector2(0, 0); - // weapon.RotationDegrees = 120; - // weapon.Scale = new Vector2(1, -1); - // } - // else if (index == 2) - // { - // weapon.Position = new Vector2(0, 5); - // weapon.RotationDegrees = 310; - // weapon.Scale = new Vector2(1, 1); - // } - // else if (index == 3) - // { - // weapon.Position = new Vector2(0, 0); - // weapon.RotationDegrees = 60; - // weapon.Scale = new Vector2(1, 1); - // } } protected override void OnAffiliationChange()