const {ccclass, property} = cc._decorator; /** * 适配器 */ @ccclass export default class Adapter extends cc.Component { onLoad(){ let widget = this.node.getComponent(cc.Widget); if(widget){ widget.target = cc.Canvas.instance.node; // if(widget.isAlignTop){ // let winsize = cc.winSize; // let dt = winsize.height / winsize.width; // if(dt >= 2.16){//刘海屏 // widget.top += 50; // } // } } } }