12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import Main from "../game/Main";
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class guideView extends cc.Component {
- @property(cc.Label)
- private lbTip: cc.Label = null;
- // LIFE-CYCLE CALLBACKS:
- onLoad () {
- // this.hide();
- }
- // update (dt) {}
- public show(str: string, delTime: number = undefined, call = undefined) {
- let me = this;
- this.lbTip.string = str;
- this.node.active = true;
- if (delTime) {
- setTimeout(() => {
- me.hide();
- if (call) {
- call();
- }
- }, delTime*1000);
- }
- Main.Ins.pauseGame();
- }
- public hide(){
- this.node.active = false;
-
- Main.Ins.resumeGame();
- }
- }
|