123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /** @format */
- import {UI} from '../enums/UI'
- import {BaseUI} from './BaseUI'
- import {Data, Mgr} from '../GameControl'
- import {ccUtils} from '../utils/ccUtils'
- import {observer, render, node, label, editBox, list} from '../mobx/observer'
- import {msgCmd} from '../proto/msg_cmd'
- import {GOODS} from '../enums/Enum'
- import {roleUpgradeRsp} from '../proto/game'
- import {IRewardNty} from '../interface/UIInterface'
- const {ccclass, property} = cc._decorator
- @ccclass
- @observer
- export class MainUI extends BaseUI {
- onShow(args, fromUI: number) {
- Mgr.ui.showTop(this, [GOODS.coin, GOODS.diamond])
- Mgr.ui.showFoot(this)
- Mgr.net.add(msgCmd.cmd_role_upgrade_rsp, this, this.onRoleUpgradeRsp)
- //Mgr.net.send(msgCmd.cmd_role_upgrade)
- }
- onHide(): any {
- Mgr.event.removeAll(this)
- }
- //UI或者其他函数=======================================
- //网络事件=======================================
- onRoleUpgradeRsp(data: roleUpgradeRsp, reward: IRewardNty) {
- Data.user.level = data.level
- Data.user.exp = data.exp
- //显示升级提示
- Mgr.ui.show(UI.RoleUpgradeUI, reward)
- }
- //触发事件=======================================
- // @render
- // showRender() {}
- // 点击事件=======================================
- // onClick() {}
- }
|