12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import SoundMgr from "../base/SoundMgr";
- import Tool from "../base/Tool";
- var baseLayer = require('BaseLayer');
- cc.Class({
- extends: baseLayer,
- properties: {
- labCoin: cc.Label,
- labLv: cc.Label,
- labCool: cc.Label,
- buyNode: cc.Node,
- getNode: cc.Node,
- coolNode: cc.Node,
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- this.labCoin.string = 1211;
- this.labLv.string = `LV${2}`;
- this.buyNode.active = false;
- this.getNode.active = false;
- this.coolNode.active = true;
- this.lerpTime = 18;
- this.daoshiji();
- this.schedule(this.daoshiji, 1, cc.macro.REPEAT_FOREVER);
- },
- onClickBuy(){
- SoundMgr.playClick();
- },
- onClickGet(){
- SoundMgr.playClick();
- },
- daoshiji(){
- if(this.lerpTime <= 1){
- this.getNode.active = true;
- this.coolNode.active = false;
- this.unschedule(this.daoshiji);
- return;
- }
- this.lerpTime -= 1;
- this.labCool.string = Tool.timesBySec(this.lerpTime);
- }
-
- });
|