1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- // 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 Plat from "../utils/Palt";
- import UIbase from "../utils/UIbase";
- import PrefabUtil from "../utils/manager/PrefabUtil";
- import FailUI from "./FailUI";
- import GameUI from "./GameUI";
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class TimeOverUI extends UIbase {
- private static _inst: TimeOverUI;
- public static get inst() {
- if (this._inst == null) {
- let v = cc.instantiate(PrefabUtil.get("TimeOverUI"));
- this._inst = v.getComponent(TimeOverUI);
- }
- return this._inst;
- }
- start () {
- }
- protected onShow(): void {
- Plat.showBanner()
- }
- protected onHide(): void {
- Plat.hideBanner()
- }
- onClickAdd(){
- Plat.showRewardVideo((success:boolean)=>{
- if(success){
- GameUI.inst.onClickAddTime()
- this.hideUI()
- }
- })
- }
- onClickCancel(){
- this.hideUI()
- FailUI.inst.showUI();
- }
- }
|