import { _decorator, BlockInputEvents, Component, Node } from 'cc'; const { ccclass, property } = _decorator; @ccclass('ui_parent') export class ui_parent extends Component { private is_bolck:boolean = false update(deltaTime: number) { if(this.node.children.length<=0&&this.is_bolck){ this.is_bolck = false this.getComponent(BlockInputEvents).enabled = false } if(this.node.children.length>0&&!this.is_bolck){ this.is_bolck = true this.getComponent(BlockInputEvents).enabled = true } } }