37 lines
827 B
TypeScript
37 lines
827 B
TypeScript
import resHelper from "../res/ResHelper";
|
|
import UIBase from "./base/UIBase";
|
|
import { PanelType } from "./config/SysDefine";
|
|
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class TipsPanel extends UIBase {
|
|
@property(cc.Label)
|
|
tips: cc.Label = null;
|
|
|
|
panelType = PanelType.TopTips;
|
|
|
|
|
|
public static async popUp(url: string, params: any) {
|
|
let prefab = await resHelper.loadResAsync<cc.Prefab>(url, cc.Prefab);
|
|
if(!prefab) return ;
|
|
let node = cc.instantiate(prefab);
|
|
let com = node.getComponent(TipsPanel);
|
|
com.tips.string = params;
|
|
// todo...
|
|
await com.exitAnim();
|
|
}
|
|
// onLoad () {}
|
|
|
|
start () {
|
|
|
|
}
|
|
|
|
async exitAnim() {
|
|
this.node.removeFromParent();
|
|
this.node.destroy();
|
|
}
|
|
|
|
// update (dt) {}
|
|
}
|