FullOutputMediator.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import { _decorator, Component, Node } from 'cc';
  2. import { GUIManager } from '../../../engines/gui/GUIManager';
  3. import { GUIMediator } from '../../../engines/gui/GUIMediator';
  4. import { SceneManager } from '../../../engines/scenes/SceneManager';
  5. import { LiangLiangSDK } from '../../../libs/liangliangSDK';
  6. import { PlatformManager } from '../../../Platform/PlatformManager';
  7. import { UIConst } from '../UIConst';
  8. const { ccclass, property } = _decorator;
  9. @ccclass('FullOutputMediator')
  10. export class FullOutputMediator extends GUIMediator {
  11. continueShowBanner:boolean = true;
  12. @property({
  13. type:Node
  14. })
  15. ContinueButton:Node=null;
  16. start () {
  17. // Your initialization goes here.
  18. this.ContinueButton.active = false;
  19. this.scheduleOnce(this.showContinueButton.bind(this), 3);
  20. }
  21. OnShow(data?:any):void{
  22. PlatformManager.hideBanner();
  23. this.data=data;
  24. }
  25. OnHide():void{
  26. }
  27. showContinueButton():void{
  28. this.ContinueButton.active = true;
  29. }
  30. /**
  31. * 返回主界面
  32. */
  33. BackToMain():void{
  34. SceneManager.single.Swicth("PrepareScene");
  35. this.HideSelf();
  36. }
  37. ContinueGame():void{
  38. if(LiangLiangSDK.CanWuChu() == true){
  39. if(this.continueShowBanner == true){
  40. this.__bannerWuChu();
  41. }else{
  42. // GUIManager.single.Show(UIConst.FIGHTING_UI);
  43. SceneManager.single.Swicth("PrepareScene");
  44. this.HideSelf();
  45. }
  46. }else{
  47. // GUIManager.single.Show(UIConst.FIGHTING_UI);
  48. SceneManager.single.Swicth("PrepareScene");
  49. this.HideSelf();
  50. }
  51. }
  52. /**
  53. * 误触逻辑
  54. */
  55. private __bannerWuChu():void{
  56. this.scheduleOnce(()=>{
  57. PlatformManager.showBanner();
  58. this.scheduleOnce(()=>{
  59. PlatformManager.hideBanner();
  60. this.continueShowBanner = false;
  61. }, 1)
  62. }, 1)
  63. }
  64. // update (deltaTime: number) {
  65. // // Your update function goes here.
  66. // }
  67. }