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 }); } } }