캐릭터 이동 애니메이션 적용

This commit is contained in:
aube.lee
2025-01-28 21:03:52 +09:00
parent ff5a714d63
commit e665360833
8 changed files with 1295 additions and 16 deletions

View File

@@ -8,15 +8,18 @@ namespace TON
{
public float speed;
public float jumpForce = 10f; // 점프 힘
public float jumpForce = 5f; // 점프 힘
private bool isGrounded = true; // 플레이어가 바닥에 있는지 여부를 판단
public Animator animator;
private VariableJoystick joystick;
public Rigidbody2D rb;
public void Start()
{
animator = GetComponent<Animator>();
joystick = ControllerUI.Instance.joystick;
ControllerUI.Instance.linkedCharactor = this;
}
@@ -30,6 +33,9 @@ namespace TON
horizontalInput = joystick.Horizontal; // 조이스틱 입력 우선
}
// TODO: 걷는 애니메이션 적용
animator.SetBool("IsMoving", Mathf.Abs(horizontalInput) > 0f);
// 좌우 이동 처리 (X축 속도 설정)
float newVelocityX = horizontalInput * speed;
@@ -67,6 +73,7 @@ namespace TON
public void Attack()
{
// TODO: 공격 애니메이션 적용
Debug.Log("character Attack");
}

View File

@@ -20,12 +20,14 @@ namespace TON
}
UIManager.Show<IngameUI>(UIList.IngameUI);
UIManager.Show<ControllerUI>(UIList.ControllerUI);
}
public override IEnumerator OnEnd()
{
yield return null;
UIManager.Hide<IngameUI>(UIList.IngameUI);
UIManager.Hide<ControllerUI>(UIList.ControllerUI);
}
void OnEscapeExecute()