1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- const {ccclass, property} = cc._decorator;
- import PrefabUtil from '../utils/manager/PrefabUtil';
- import UIbase from '../utils/UIbase';
- import GameUI from './GameUI';
- import Plat from '../utils/Palt';
- import SettingUI from './SettingUI';
- import ShopUI from './ShopUI';
- import rankUI from './rankUI';
- import AudioMgr from '../manager/AudioMgr';
- import AudioPath from '../datas/AudioPath';
- @ccclass
- export default class HomeUI extends UIbase {
- private static _inst:HomeUI;
- public static get inst()
- {
- if(this._inst==null)
- {
- let v=cc.instantiate(PrefabUtil.get("HomeUI"));
- this._inst=v.getComponent(HomeUI);
- }
- return this._inst;
- }
- protected onShow(): void {
- Plat.showInterstitialAd();
- Plat.showBanner();
- AudioMgr.playBgm();
- }
- protected onHide(): void {
- Plat.hideBanner()
- }
- public onClickStartGame()
- {
- this.hideUI();
- GameUI.inst.onStartGame();
- AudioMgr.playSound(AudioPath.CLICK);
- }
-
- public onClickShare()
- {
- Plat.shareAppMessage();
- AudioMgr.playSound(AudioPath.CLICK);
- }
- public onClickRank()
- {
- rankUI.inst.showUI();
- AudioMgr.playSound(AudioPath.CLICK);
- }
- public onClickSettingBtn()
- {
- SettingUI.inst.showUI();
- AudioMgr.playSound(AudioPath.CLICK);
- }
- onClickShop(){
- ShopUI.inst.showUI();
- AudioMgr.playSound(AudioPath.CLICK);
- }
- public onJump(event,appid)
- {
- if(Plat.pt.navigateToMiniProgram!=null)
- {
- Plat.pt.navigateToMiniProgram({
- "appId":appid
- });
- }
- }
-
- }
|