From 40b5619114f2c38ba86a64aaec6af8b699976eb7 Mon Sep 17 00:00:00 2001 From: Jay <96156114+jaydev00a@users.noreply.github.com> Date: Thu, 24 Apr 2025 14:35:56 +0900 Subject: [PATCH] =?UTF-8?q?DEG-94=20[STYLE]=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JAY/Scripts/IPlayerAction/PlayerActionDash.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Assets/JAY/Scripts/IPlayerAction/PlayerActionDash.cs b/Assets/JAY/Scripts/IPlayerAction/PlayerActionDash.cs index 0b7904e2..e8336ea7 100644 --- a/Assets/JAY/Scripts/IPlayerAction/PlayerActionDash.cs +++ b/Assets/JAY/Scripts/IPlayerAction/PlayerActionDash.cs @@ -3,14 +3,14 @@ public class PlayerActionDash : IPlayerAction { private PlayerController player; - private float duration = 0.25f; - private float timer; - private Vector3 direction; + private float duration = 0.25f; // 대시 유지 시간 + private float timer; // 대시 경과 시간 + private Vector3 direction; // 대시 방향 private float dashSpeedMultiplier = 3f; // 기본 이동 속도의 n배 - private float dashSpeed; + private float dashSpeed; // 실제 대시 속도(계산한 값) - public bool IsActive { get; private set; } + public bool IsActive { get; private set; } // 현재 대시 중인지 여부 public void StartAction(PlayerController player) { @@ -18,10 +18,13 @@ public class PlayerActionDash : IPlayerAction IsActive = true; timer = 0f; + // 조이스틱 입력값 있으면 그 방향, 없으면 캐릭터가 바라보는 방향 direction = player.GetMoveDirectionOrForward().normalized; + // 대시 속도 = 이동 속도 x 배수 dashSpeed = player.moveSpeed * dashSpeedMultiplier; + // TODO: 필요 시 애니메이션 재생 // player.PlayerAnimator.SetTrigger("Roll"); }