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.
51 lines
1.9 KiB
51 lines
1.9 KiB
//#region 文件引入
|
|
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText, tween, UIOpacity } from "cc";
|
|
import BaseUIForm from "../../Mgr_UI/BaseUIForm";
|
|
import LocalStorage from "../../Mgr_LocalData/LocalStorage";
|
|
import MesMgr from "../../MesEvent/MesMgr";
|
|
import { EGlobalEvent } from "../../MesEvent/EGlobalEvent";
|
|
import UIMgr from "../../Mgr_UI/UIMgr";
|
|
import { EUIForms } from "../../const/UIFormCnf";
|
|
import { PropType } from "../../const/GameEnum";
|
|
//#endregion 文件引入
|
|
const {ccclass, property,menu} = _decorator;
|
|
@ccclass("RestartLoadingUI_Proxy")
|
|
export default class RestartLoadingUI_Proxy extends BaseUIForm{
|
|
//#region 节点自动生成
|
|
|
|
//#endregion 节点自动生成
|
|
|
|
private pNodeOpacity: UIOpacity = null;
|
|
onButtonClick(button:Button){
|
|
|
|
/**点击事件触发*/
|
|
switch (button) {
|
|
default:
|
|
ConsoleEx.Log(button);
|
|
break;
|
|
}
|
|
}
|
|
|
|
protected start(): void {
|
|
this.pNodeOpacity = CNodeUtils.getOrAddComponent(this.node, UIOpacity);
|
|
LocalStorage.mReBuilding = true;
|
|
LocalStorage.reBuildAllData();
|
|
this.mDataMgr.Soul.rebuild();
|
|
this.mDataMgr.Scene.rebuild();
|
|
this.mDataMgr.Role.rebuild();
|
|
this.mDataMgr.Token.addToken(PropType.eGold, 100000);
|
|
this.mDataMgr.Token.addToken(PropType.eAdopt, 2);
|
|
MesMgr.event(EGlobalEvent.RESTART_NEWGAME);
|
|
this.scheduleOnce(()=>{this.fadeOutElement()}, 3);
|
|
}
|
|
|
|
// 渐隐消失
|
|
private fadeOutElement() {
|
|
tween(this.pNodeOpacity).to(0.5, {opacity:0}).call(() => {
|
|
LocalStorage.mReBuilding = false;
|
|
UIMgr.Ins.ShowUI(EUIForms.PopRstRewardUI, {param:{coin:100000,xwf:1,backexp:this.mDataMgr.Soul.exp,backxwf:1}});
|
|
this.CloseUI();
|
|
}).start();
|
|
}
|
|
|
|
}
|