int layerMask = 1 << gameObject.layer; //此camera负责渲染的层中是否包含gameObject所属层 if ((camera.cullingMask & layerMask) != 0){ //包含 }