diff --git a/prefab/role/Role.tscn b/prefab/role/Role.tscn index a7d86e4..92fec16 100644 --- a/prefab/role/Role.tscn +++ b/prefab/role/Role.tscn @@ -85,7 +85,7 @@ position = Vector2( 0, -12 ) frames = SubResource( 6 ) animation = "idle" -frame = 3 +frame = 2 playing = true [node name="HitArea" type="Area2D" parent="."] @@ -104,5 +104,5 @@ z_index = 1 [node name="BackMountPoint" type="Position2D" parent="."] -position = Vector2( 0, -5 ) +position = Vector2( 0, -10 ) z_index = -1 diff --git a/src/package/Holster.cs b/src/package/Holster.cs index 5dcbc66..f2b1297 100644 --- a/src/package/Holster.cs +++ b/src/package/Holster.cs @@ -96,7 +96,8 @@ { index = 0; } - if (ExchangeByIndex(index)) { + if (ExchangeByIndex(index)) + { return index; } index++; @@ -118,8 +119,29 @@ { ActiveGun.GetParent().RemoveChild(ActiveGun); Master.BackMountPoint.AddChild(ActiveGun); - ActiveGun.RotationDegrees = 60; - ActiveGun.Scale = new Vector2(-1, 1); + if (ActiveIndex == 0) + { + ActiveGun.Position = new Vector2(0, 5); + ActiveGun.RotationDegrees = 50; + ActiveGun.Scale = new Vector2(-1, 1); + } + else if (ActiveIndex == 1) + { + ActiveGun.RotationDegrees = 120; + ActiveGun.Scale = new Vector2(1, -1); + } + else if (ActiveIndex == 2) + { + ActiveGun.Position = new Vector2(0, 5); + ActiveGun.RotationDegrees = 310; + ActiveGun.Scale = new Vector2(1, 1); + } + else if (ActiveIndex == 3) + { + ActiveGun.RotationDegrees = 60; + ActiveGun.Scale = new Vector2(1, 1); + } + } //更改父节点 @@ -134,6 +156,7 @@ Master.MountPoint.AddChild(slot.Gun); } + slot.Gun.Position = Vector2.Zero; slot.Gun.Scale = Vector2.One; slot.Gun.RotationDegrees = 0; ActiveGun = slot.Gun; diff --git a/src/role/Player.cs b/src/role/Player.cs index d11bb27..e9ba08c 100644 --- a/src/role/Player.cs +++ b/src/role/Player.cs @@ -27,9 +27,12 @@ public override void _Ready() { base._Ready(); - + Holster.SlotList[2].Enable = true; + Holster.SlotList[3].Enable = true; PickUpGun(GunManager.GetGun1()); //0 PickUpGun(GunManager.GetGun2()); //1 + PickUpGun(GunManager.GetGun1()); //2 + PickUpGun(GunManager.GetGun2()); //3 } public override void _Process(float delta)