点击忽略Ignore层
This commit is contained in:
parent
a0f0405ae0
commit
bbf6fd7246
@ -56,6 +56,11 @@ namespace QFramework
|
|||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
if (Physics.Raycast(ray, out 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)
|
if (isRight)
|
||||||
{
|
{
|
||||||
return obj == hit.collider.gameObject;
|
return obj == hit.collider.gameObject;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user