|
@@ -1,8 +1,9 @@
|
|
|
-import { _decorator, Component, Node, LabelComponent } from 'cc';
|
|
|
+import { _decorator, Component, Node, LabelComponent, Vec2, Vec3, view } from 'cc';
|
|
|
import { GUIManager } from '../../../engines/gui/GUIManager';
|
|
|
import { GUIMediator } from '../../../engines/gui/GUIMediator';
|
|
|
import { NoticeManager } from '../../../engines/notices/NoticeManager';
|
|
|
import { SceneManager } from '../../../engines/scenes/SceneManager';
|
|
|
+import { LiangLiangSDK } from '../../../libs/liangliangSDK';
|
|
|
import { PlatformManager } from '../../../Platform/PlatformManager';
|
|
|
import GameConfigManager from '../../models/GameConfigManager';
|
|
|
import { GameModel } from '../../models/GameModel';
|
|
@@ -22,10 +23,18 @@ export class GameOverMediator extends GUIMediator {
|
|
|
|
|
|
@property(Node)
|
|
|
DefeatedGroup: Node = null;
|
|
|
+
|
|
|
+ @property(Node)
|
|
|
+ WinBackButton: Node = null;
|
|
|
+
|
|
|
+ @property(Node)
|
|
|
+ DefeatedBackButton: Node = null;
|
|
|
+
|
|
|
private isWin: boolean;
|
|
|
private award: number;
|
|
|
+
|
|
|
onLoad() {
|
|
|
- PlatformManager.showBanner()
|
|
|
+ // PlatformManager.showBanner()
|
|
|
}
|
|
|
|
|
|
OnShow(data?: any): void {
|
|
@@ -46,6 +55,25 @@ export class GameOverMediator extends GUIMediator {
|
|
|
this.WinGroup.active = false;
|
|
|
this.DefeatedGroup.active = true;
|
|
|
}
|
|
|
+
|
|
|
+ this.backButtonHandle();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 返回按钮误触
|
|
|
+ */
|
|
|
+ backButtonHandle(): void {
|
|
|
+ if (LiangLiangSDK.CanWuChu() == true) {
|
|
|
+ this.WinBackButton.position = new Vec3(0, -(view.getVisibleSize().height / 2 - 50), 0);
|
|
|
+ this.DefeatedBackButton.position = new Vec3(0, -(view.getVisibleSize().height / 2 - 50), 0);
|
|
|
+ this.scheduleOnce(() => {
|
|
|
+ PlatformManager.showBanner();
|
|
|
+ this.WinBackButton.position = new Vec3(0, -375, 0);
|
|
|
+ this.DefeatedBackButton.position = new Vec3(0, -358, 0);
|
|
|
+ }, 3)
|
|
|
+ } else {
|
|
|
+ PlatformManager.showBanner();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -94,8 +122,8 @@ export class GameOverMediator extends GUIMediator {
|
|
|
/**
|
|
|
* 十倍之后去全屏界面
|
|
|
*/
|
|
|
- getTenAward():void{
|
|
|
- this.AddAdAward(10, ()=>{
|
|
|
+ getTenAward(): void {
|
|
|
+ this.AddAdAward(10, () => {
|
|
|
GUIManager.single.Show(UIConst.FULL_OUTPUT_UI);
|
|
|
this.HideSelf();
|
|
|
});
|