fix: 캐릭터가 벽에 충돌했을때 추락하게 하도록 로직 적용

This commit is contained in:
aube.lee
2025-02-20 11:07:09 +09:00
parent ae1cc1d39e
commit 256036c17e
5 changed files with 402 additions and 85 deletions

View File

@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TON
{
public class WallChecker : MonoBehaviour
{
public bool IsWallTouching { get; private set; }
private void OnTriggerStay2D(Collider2D other)
{
IsWallTouching = other.gameObject.layer == LayerMask.NameToLayer("Ground");
}
private void OnTriggerExit2D(Collider2D other)
{
if (other.gameObject.layer == LayerMask.NameToLayer("Ground"))
{
IsWallTouching = false;
}
}
}
}