12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- var baseScene = require('BaseScene');
- import SoundMgr from "../base/SoundMgr";
- import Tool from "../base/Tool";
- import UIMgr from "../base/UIMgr";
- import UserInfoMgr from "../base/user/UserInfoMgr";
- cc.Class({
- extends: cc.Component,
- properties: {
- labCoin: cc.Label,
- labBli: cc.Label,
- dropDownNode: cc.Node, //下拉内容
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- },
- // update (dt) {},
- setPlayerInfo(){
- this.labCoin.string = UserInfoMgr.getUserCoin();
- this.labBli.string = UserInfoMgr.getUserBli();
- },
- //---------------------点击事件---------------------------
- onClickMenu(){
- SoundMgr.playClick();
- this.dropDownNode.active = !this.dropDownNode.active;
- let tPosY = [125, 35, -55, -150];
- if(this.timeOut)
- clearTimeout(this.timeOut);
- if(this.dropDownNode.active){
- Tool.effectMoveY(this.dropDownNode, tPosY);
- this.timeOut = setTimeout(()=>{
- this.dropDownNode.active = false;
- }, 3000);
- }
- },
- onClickCoin(){
- SoundMgr.playClick();
- UIMgr.openUI('prefabs/Shop2Layer');
- },
- onClickBli(){
- SoundMgr.playClick();
- UIMgr.openUI('prefabs/Exchange2Layer');
- }
- });
|