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.
61 lines
1.8 KiB
61 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 AppPlatform from "../../FrameWork/Util/AppPlatform";
|
|
import Common5 from "../../Platform/th/Common5";
|
|
import TTAPI from "../../Platform/tt/TTAPI";
|
|
import UiBase from "../GameBase/UiBase";
|
|
import LevelUpManager from "../Manager/LevelUpManager";
|
|
import UserManager from "../Manager/UserManager";
|
|
import PrefabManage from "../PrefabManager/PrefabManage";
|
|
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class addDeskScript extends UiBase {
|
|
|
|
start () {
|
|
if(User.getAddDesk()){
|
|
this.node.getChildByName('addBtn').active = false
|
|
this.node.getChildByName('FreeBtn').active = true
|
|
}
|
|
}
|
|
|
|
addDesk(){
|
|
if (AppPlatform.is_TT_GAME_custom()) {
|
|
TTAPI.addToZM(()=>{
|
|
Common5.ReportDY('inLevel','添加桌面-完成')
|
|
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
lingquBtnClick(){
|
|
User.setDeskReward(true)
|
|
|
|
let earnMoney = LevelUpManager.levelUpSpned()
|
|
// if(earnMoney*3>=100000){
|
|
// UserManager.addMoney(earnMoney*3)
|
|
// }else{
|
|
UserManager.addMoney(100000)
|
|
// }
|
|
LevelUpManager.peopleLevelUp(10)
|
|
|
|
PrefabManage.showTextTips('添加桌面奖励到账',2)
|
|
EventMgr.emitEvent_custom(ryw_Event.updateHideBtn);
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
}
|
|
|
|
|
|
// update (dt) {}
|
|
}
|
|
|