mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fix raycastUI (#4440)
This commit is contained in:
committed by
Weiliang Wang
parent
7f5d84116f
commit
59b55d9260
@@ -257,7 +257,7 @@ export class RenderScene {
|
||||
public raycastUI (worldRay: ray, mask: number = Layers.UI): IRaycastResult[] {
|
||||
poolUI.reset();
|
||||
const canvasComs = cc.director.getScene().getComponentsInChildren(cc.CanvasComponent);
|
||||
if (canvasComs != null) {
|
||||
if (canvasComs != null && canvasComs.length > 0) {
|
||||
const canvasNode = canvasComs[0].node as Node;
|
||||
if (canvasNode != null && canvasNode.active) {
|
||||
this._raycastUINodeRecursiveChildren(worldRay, mask, canvasNode);
|
||||
|
||||
Reference in New Issue
Block a user