1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- const { ccclass, property } = cc._decorator;
- import AudioPath from '../datas/AudioPath';
- import AudioMgr from '../manager/AudioMgr';
- import { DataMgr } from '../manager/DataMgr';
- import PrefabUtil from '../utils/manager/PrefabUtil';
- import Plat from '../utils/Palt';
- import UIbase from '../utils/UIbase';
- import GameUI from './GameUI';
- @ccclass
- export default class FailUI extends UIbase {
- private static _inst: FailUI;
- public static get inst() {
- if (this._inst == null) {
- let v = cc.instantiate(PrefabUtil.get("FailUI"));
- this._inst = v.getComponent(FailUI);
- }
- return this._inst;
- }
- @property(cc.Sprite)
- cat: cc.Sprite = null;
- public showUI(data?: any): void {
- super.showUI(data)
- const id = DataMgr.ins.getRandomId();
- // cc.resources.load("/cat/cat_skin_" + id, cc.SpriteFrame, (error, frame) => {
- // this.cat.spriteFrame = frame
- // })
- }
- protected onShow(): void {
- Plat.showBanner()
- Plat.showInterstitialAd()
- }
- protected onHide(): void {
- Plat.hideBanner()
- }
- public onClickStartGame() {
- this.hideUI();
- GameUI.inst.onStartGame();
- AudioMgr.playSound(AudioPath.CLICK);
- }
- public onClickShare() {
- Plat.shareAppMessage();
- AudioMgr.playSound(AudioPath.CLICK);
- }
- }
|