BasePlatform.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { GameMng } from "../../GameMng";
  2. import AudioMng from "../AudioMng";
  3. import { Singleton } from "../Singleton";
  4. export class BasePlatform extends Singleton<BasePlatform>() {
  5. shareobj = {
  6. title: "[有人@你]经典残局等你来战,快来试试吧!",
  7. imageUrl: "Res/texture/glow.png",
  8. query: ""
  9. }
  10. //banner
  11. protected bannerAd:any=null;
  12. public bannerdisTime:number=0;
  13. public bannerrefreshTime:number=10000;
  14. //插屏
  15. protected pagead:any=null;
  16. //视频
  17. protected videoloaded:boolean=false;
  18. protected rewardedVideoAd:any=null;
  19. protected videoSucCall:Function=null;
  20. //初始化
  21. init(){
  22. }
  23. //显示插屏广告
  24. showPageAd(onSucc?: Function, onFail?: Function, caller?: any): void {
  25. console.log('base');
  26. if (onSucc) onSucc.call(caller);
  27. if (onFail) onFail.call(caller);
  28. }
  29. //关闭插屏
  30. closePageAd(){
  31. }
  32. //显示视频广告
  33. showVideoAd(onSucc?: Function, onFail?: Function, caller?: any): void {
  34. console.log('base');
  35. if (onSucc) onSucc.call(caller);
  36. if (onFail) onFail.call(caller);
  37. }
  38. showPlatformMsg() {
  39. }
  40. showModal(obj: any) {
  41. }
  42. share(shareObj, onSucc, caller) {
  43. if (onSucc) {
  44. AudioMng.Instance.PlayBGM(GameMng.Instance.gamebgm);
  45. onSucc.call(caller);
  46. }
  47. }
  48. }