const { ccclass } = cc._decorator; @ccclass export default class auto_toastMessage extends cc.Component { toastMessage: cc.Node; toastBg: cc.Node; message: cc.Node; public static URL:string = "db://assets/resources/prefab/common/toastMessage.prefab" onLoad () { this.toastMessage = this.node this.toastBg = this.toastMessage.getChildByName("toastBg"); this.message = this.toastBg.getChildByName("message"); } }