点击忽略Ignore层

This commit is contained in:
shenjianxing 2025-02-26 14:07:34 +08:00
parent a0f0405ae0
commit bbf6fd7246

View File

@ -56,6 +56,11 @@ namespace QFramework
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.gameObject.layer == LayerMask.GetMask("Ignore"))
{
Debug.LogError("点击了忽略的物体" + hit.collider.gameObject.name);
return false;
}
if (isRight)
{
return obj == hit.collider.gameObject;