Преглед на файлове

Merge branch 'master' of http://120.92.132.192:23541/TDGame/TDGameClient3D

w405651948 преди 4 години
родител
ревизия
7e4dea60b1
променени са 3 файла, в които са добавени 145 реда и са изтрити 71 реда
  1. 1 26
      assets/resources/ui/ads/AdvertisingUI.prefab
  2. 73 17
      assets/resources/ui/ads/DaochuItemUI.prefab
  3. 71 28
      assets/scripts/games/ui/gameovers/GameOverMediator.ts

+ 1 - 26
assets/resources/ui/ads/AdvertisingUI.prefab

@@ -30,13 +30,10 @@
       },
       {
         "__id__": 43
-      },
-      {
-        "__id__": 44
       }
     ],
     "_prefab": {
-      "__id__": 45
+      "__id__": 44
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1289,28 +1286,6 @@
     },
     "_id": ""
   },
-  {
-    "__type__": "c0862GgEItM5YUlULTjLR6o",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 1
-    },
-    "_enabled": true,
-    "scrollView": {
-      "__id__": 37
-    },
-    "content": {
-      "__id__": 32
-    },
-    "itemPrefab": {
-      "__uuid__": "a35d4a29-693b-410b-bc10-5cce31760afd"
-    },
-    "scrollType": 2,
-    "autoScroll": true,
-    "scrollSpeed": 50,
-    "_id": ""
-  },
   {
     "__type__": "13aafaONKJHmpOKTBxdeXnm",
     "_name": "",

+ 73 - 17
assets/resources/ui/ads/DaochuItemUI.prefab

@@ -23,26 +23,29 @@
         "__id__": 6
       },
       {
-        "__id__": 9
+        "__id__": 10
       },
       {
-        "__id__": 13
+        "__id__": 14
       }
     ],
     "_active": true,
     "_components": [
-      {
-        "__id__": 17
-      },
       {
         "__id__": 18
       },
       {
         "__id__": 19
+      },
+      {
+        "__id__": 20
+      },
+      {
+        "__id__": 21
       }
     ],
     "_prefab": {
-      "__id__": 20
+      "__id__": 22
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -204,10 +207,13 @@
     "_components": [
       {
         "__id__": 7
+      },
+      {
+        "__id__": 8
       }
     ],
     "_prefab": {
-      "__id__": 8
+      "__id__": 9
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -258,6 +264,40 @@
     },
     "_id": ""
   },
+  {
+    "__type__": "cc.SpriteComponent",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 6
+    },
+    "_enabled": true,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_sharedMaterial": null,
+    "_spriteFrame": null,
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
   {
     "__type__": "cc.PrefabInfo",
     "root": {
@@ -284,14 +324,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 10
+        "__id__": 11
       },
       {
-        "__id__": 11
+        "__id__": 12
       }
     ],
     "_prefab": {
-      "__id__": 12
+      "__id__": 13
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -326,7 +366,7 @@
     "_name": "Label<UITransformComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 9
+      "__id__": 10
     },
     "_enabled": true,
     "_priority": 0,
@@ -347,7 +387,7 @@
     "_name": "Label<LabelComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 9
+      "__id__": 10
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -404,14 +444,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 14
+        "__id__": 15
       },
       {
-        "__id__": 15
+        "__id__": 16
       }
     ],
     "_prefab": {
-      "__id__": 16
+      "__id__": 17
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -446,7 +486,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 13
+      "__id__": 14
     },
     "_enabled": true,
     "_priority": 0,
@@ -467,7 +507,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 13
+      "__id__": 14
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -628,6 +668,22 @@
     },
     "_id": ""
   },
+  {
+    "__type__": "89bf827dnVIrYRVh5P9587o",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "icon": {
+      "__id__": 8
+    },
+    "label": {
+      "__id__": 12
+    },
+    "_id": ""
+  },
   {
     "__type__": "cc.PrefabInfo",
     "root": {

+ 71 - 28
assets/scripts/games/ui/gameovers/GameOverMediator.ts

@@ -52,7 +52,10 @@ export class GameOverMediator extends GUIMediator {
 
     private isWin: boolean;
     private award: number;
-    private diamond:number;
+    private diamond: number;
+
+    private buttonCkilcBool: boolean = false;
+    private buttonClickIsOk: boolean = false;
     onLoad() {
         // PlatformManager.showBanner()
     }
@@ -64,54 +67,58 @@ export class GameOverMediator extends GUIMediator {
         this.DefeatedGroup.active = !this.isWin;
         //胜利
         if (this.isWin == true) {
-            this.WinGroup.active = true;
+            this.scheduleOnce(()=>{
+                this.WinGroup.active = true;
+            }, 2)
             this.DefeatedGroup.active = false;
             let levelConfig: any = GameConfigManager.GetLevelConfig(GameModel.single.currentLevel - 1);
             //关卡基础奖励
             this.award = levelConfig.awards + levelConfig.killAward * GameModel.single.killCount;
             //金币奖励
-            this.WinAwardLabel.string ="X"+StringUtils.numberUtilsEn(this.award,0);
+            this.WinAwardLabel.string = "X" + StringUtils.numberUtilsEn(this.award, 0);
             //钻石奖励
-            if(levelConfig.diamondRewards>0){
-                this.diamond=levelConfig.diamondRewards;
-                this.DiamondAwardLabel.string="X"+StringUtils.numberUtilsEn(levelConfig.diamondRewards,0);
-            }else{
-                this.diamond=0;
-                this.DiamondAwardLabel.string="";
+            if (levelConfig.diamondRewards > 0) {
+                this.diamond = levelConfig.diamondRewards;
+                this.DiamondAwardLabel.string = "X" + StringUtils.numberUtilsEn(levelConfig.diamondRewards, 0);
+            } else {
+                this.diamond = 0;
+                this.DiamondAwardLabel.string = "";
             }
             let weChat = PlatformManager.impl as WeChatPlatform;
-            if(weChat instanceof WeChatPlatform){
+            if (weChat instanceof WeChatPlatform) {
                 // weChat.successBranchAnalytics(String(GameModel.single.currentLevel));
                 weChat.branchAnalytics(branchIdType.SuccessGame, String(GameModel.single.currentLevel))
             }
         } else {//失败
             //失败不算奖励
             this.WinGroup.active = false;
-            this.DefeatedGroup.active = true;
+            this.scheduleOnce(()=>{
+                this.DefeatedGroup.active = true;
+            }, 2)
             let weChat = PlatformManager.impl as WeChatPlatform;
-            if(weChat instanceof WeChatPlatform){
+            if (weChat instanceof WeChatPlatform) {
                 // weChat.failBranchAnalytics(String(GameModel.single.currentLevel));
                 weChat.branchAnalytics(branchIdType.FailGame, String(GameModel.single.currentLevel))
             }
         }
-        this.backButtonHandle();
+        // 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();
-        }
+        // 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();
+        // }
     }
 
     /**
@@ -152,9 +159,45 @@ export class GameOverMediator extends GUIMediator {
      * 去全屏幕界面
      */
     GoToFullOutput(): void {
-        this.AddAward();
-        GUIManager.single.Show(UIConst.FULL_OUTPUT_UI);
-        this.HideSelf();
+        if(LiangLiangSDK.CanWuChu() == true){
+            if(this.buttonCkilcBool == false){
+                this.buttonCkilcBool = true;
+                this.scheduleOnce(()=>{
+                    PlatformManager.showBanner();
+                    this.scheduleOnce(()=>{
+                        PlatformManager.hideBanner();
+                        this.buttonClickIsOk = true;
+                    }, 1)
+                }, 1)
+            }else{
+                if(this.buttonClickIsOk == true){
+                    this.buttonClickIsOk = false;
+                    this.goOn();
+                }
+            }
+        }else{
+            this.AddAward();
+            this.HideSelf();
+        }
+    }
+
+    goOn():void{
+        let random:number = Math.random();
+        if(random < 0.5){
+            PlatformManager.showRewardedVideo(()=>{
+                this.AddAward();
+                GUIManager.single.Show(UIConst.FULL_OUTPUT_UI);
+                this.HideSelf();
+            }, ()=>{
+                this.AddAward();
+                GUIManager.single.Show(UIConst.FULL_OUTPUT_UI);
+                this.HideSelf();
+            })
+        }else{
+            this.AddAward();
+            GUIManager.single.Show(UIConst.FULL_OUTPUT_UI);
+            this.HideSelf();
+        }
     }
 
     /**
@@ -188,7 +231,7 @@ export class GameOverMediator extends GUIMediator {
     private AddAward(value: number = 1): void {
         if (this.isWin) {
             GameModel.single.gold += this.award * value;
-            GameModel.single.diamond+=this.diamond*value;
+            GameModel.single.diamond += this.diamond * value;
         }
     }