咸鱼的反击
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
xianyudefanji/assets/Scripts/MainHall/ChaoFanDesk.ts

59 lines
1.8 KiB

// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import { ryw_Event } from "../../FrameWork/Event/EventEnum";
import EventMgr from "../../FrameWork/Event/EventMgr";
import User from "../../FrameWork/User/User";
import Common5 from "../../Platform/th/Common5";
import TanWeiManager from "../Manager/TanWeiManager";
const { ccclass, property } = cc._decorator;
@ccclass
export default class ChaoFanDesk extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start() {
//监听菜单升级
this.refreshView()
EventMgr.onEvent_custom(ryw_Event.unlockItem, () => {
this.refreshView()
}, this)
}
refreshView() {
let array = User.getTanweiArray()
let oldOrNew
// if (!TanWeiManager.getLockById(5)) {
// oldOrNew = this.node.getChildByName("new")
// this.node.getChildByName("old").active = false
// } else {
oldOrNew = this.node.getChildByName("old")
this.node.getChildByName("new").active = false
// }
for (let i = 0; i < array.length; i++) {
if (array[i].isLock == false) {
let configDate = TanWeiManager.getShipuConfigDate(array[i].id)
let node = oldOrNew.getChildByName(configDate.name)
if (node) {
node.active = true
node.opacity = 255
// Common5.addUrlSprite_custom('tanweiTexture/baifang/' + configDate.name, node.getComponent(cc.Sprite))
}
}
}
}
// update (dt) {}
}