17 lines
353 B
C#
17 lines
353 B
C#
using UnityEngine;
|
|
|
|
public class WallCheck : MonoBehaviour
|
|
{
|
|
public bool touchingWall;
|
|
private void OnCollisionEnter2D(Collision2D other)
|
|
{
|
|
if (other.gameObject.layer == 6) touchingWall = true;
|
|
}
|
|
|
|
private void OnCollisionExit2D(Collision2D other)
|
|
{
|
|
if (other.gameObject.layer == 6) touchingWall = false;
|
|
}
|
|
|
|
}
|