123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import { _decorator, Component, find, Node } from 'cc';
- import { Layout_Fail } from './Layout_Fail';
- import { UI_Main } from '../UI_Main/UI_Main';
- import { UI_Hall } from '../UI_Hall/UI_Hall';
- import { UI_Idioms } from '../UI_Idioms/UI_Idioms';
- import { GameUILayers, gui } from '../../../core/ui/ui';
- import ui_base from '../../../core/ui/ui_base';
- import { ResUtil } from '../../../core/util/ResUtil';
- import { Container_Manager } from '../../../Scripts/Container_Manager';
- import { ModuleDef } from '../../../Scripts/ModuleDef';
- import { SceneDef } from '../../../Scripts/SceneDef';
- const { ccclass, property } = _decorator;
- @ccclass('UI_Fail')
- export class UI_Fail extends ui_base {
- constructor() {
- super(ModuleDef.GAME, 'ui/UI_Fail/Fail', GameUILayers.HUD, Layout_Fail);
- }
- protected async onCreated() {
- const layout = this.getLayout<Layout_Fail>();
- layout.Container=find('Container').getComponent(Container_Manager);
- this.onButtonEvent(layout.Relife_Btn, async (button: any) => {
- //跳转广告
- //关闭设置界面
- //gui.close(UI_Fail);
- }, this);
- this.onButtonEvent(layout.ReturnHall_Btn, async (button: any) => {
- //跳转场景回到主页
- await gui.closeAll();
- gui.show(UI_Hall);
- ResUtil.loadScene(SceneDef.Hall, ModuleDef.GAME, true);
- }, this);
- layout.progressBar.progress = (layout.Container.index.length -layout.Container.idioms.length) / layout.Container.index.length;
- layout.Num.string = layout.progressBar.progress * 100 + '%';
- }
- }
|