Procházet zdrojové kódy

射击起始位置

= před 4 roky
rodič
revize
fd3a15c1d0
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      Assets/Resources/Entities/Player.cs

+ 1 - 1
Assets/Resources/Entities/Player.cs

@@ -97,7 +97,7 @@ public class Player : EntityBase {
         if (InputM.GetKeyEvent(InputM.KeyType.Fire) && currentBullet > 0 && currentShootDelay <= 0f && currentReloadDelay <= 0f) {
             AudioM.Play("fire", 0.25f);
             currentBullet--; currentShootDelay = shootDelay;
-            Vector2 fromPos = transform.position + Vector3.up * 0.55f;
+            Vector2 fromPos = transform.position + Vector3.up * ((canCrouch && isPressingCrouch()) ? 0.55f : 1.3f);
             Vector2 toPos = AspectUtility.cam.ScreenToWorldPoint(Input.mousePosition);
             Vector2 shootVector = (toPos - fromPos).normalized;
             GameObject newBullet = Instantiate(bullet, fromPos, Quaternion.identity);