12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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 WinUI extends UIbase {
- private static _inst:WinUI;
- public static get inst()
- {
- if(this._inst==null)
- {
- let v=cc.instantiate(PrefabUtil.get("WinUI"));
- this._inst=v.getComponent(WinUI);
- }
- 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);
- }
-
-
- }
|