From 41a2cebf41cf49da85a16301294730aafcb083dc Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Wed, 4 Sep 2024 23:23:22 +0800 Subject: [PATCH] =?UTF-8?q?Improved=20recoil=20algorithm.=20=E6=94=B9?= =?UTF-8?q?=E8=BF=9B=E5=90=8E=E5=BA=A7=E5=8A=9B=E7=AE=97=E6=B3=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/weapon/WeaponTemplate.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/weapon/WeaponTemplate.cs b/scripts/weapon/WeaponTemplate.cs index a430b23..00e842a 100644 --- a/scripts/weapon/WeaponTemplate.cs +++ b/scripts/weapon/WeaponTemplate.cs @@ -93,8 +93,7 @@ public abstract partial class WeaponTemplate : PickAbleTemplate //我们在每次开火之前,检查武器的后坐力。 if (_recoilStrength != 0) { - var force = -characterTemplate.GlobalPosition.DirectionTo(enemyGlobalPosition) * _recoilStrength * Config.CellSize; - characterTemplate.AddForce(force); + characterTemplate.AddForce(enemyGlobalPosition.DirectionTo(characterTemplate.GlobalPosition) * _recoilStrength * Config.CellSize); } }