xujialiang преди 4 години
родител
ревизия
f5e1ba94c7

+ 33 - 158
assets/resources/ui/ads/AdvertisingUI.prefab

@@ -20,20 +20,20 @@
         "__id__": 2
       },
       {
-        "__id__": 35
+        "__id__": 31
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 46
+        "__id__": 42
       },
       {
-        "__id__": 47
+        "__id__": 43
       }
     ],
     "_prefab": {
-      "__id__": 48
+      "__id__": 44
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -82,22 +82,19 @@
       },
       {
         "__id__": 24
-      },
-      {
-        "__id__": 28
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 32
+        "__id__": 28
       },
       {
-        "__id__": 33
+        "__id__": 29
       }
     ],
     "_prefab": {
-      "__id__": 34
+      "__id__": 30
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -779,7 +776,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "TxtTips",
+    "_name": "Label",
     "_objFlags": 0,
     "_parent": {
       "__id__": 2
@@ -797,126 +794,6 @@
     "_prefab": {
       "__id__": 27
     },
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": -1120,
-      "z": 0
-    },
-    "_lrot": {
-      "__type__": "cc.Quat",
-      "x": 0,
-      "y": 0,
-      "z": 0,
-      "w": 1
-    },
-    "_lscale": {
-      "__type__": "cc.Vec3",
-      "x": 1,
-      "y": 1,
-      "z": 1
-    },
-    "_layer": 33554432,
-    "_euler": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_id": ""
-  },
-  {
-    "__type__": "cc.UITransformComponent",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 24
-    },
-    "_enabled": true,
-    "_priority": 0,
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 208,
-      "height": 50.4
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_id": ""
-  },
-  {
-    "__type__": "cc.LabelComponent",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 24
-    },
-    "_enabled": true,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_sharedMaterial": null,
-    "_useOriginalSize": true,
-    "_string": "点击空白区域关闭",
-    "_horizontalAlign": 1,
-    "_verticalAlign": 1,
-    "_actualFontSize": 26,
-    "_fontSize": 26,
-    "_fontFamily": "Arial",
-    "_lineHeight": 40,
-    "_overflow": 0,
-    "_enableWrapText": true,
-    "_font": null,
-    "_isSystemFontUsed": true,
-    "_isItalic": false,
-    "_isBold": false,
-    "_isUnderline": false,
-    "_cacheMode": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__id__": 0
-    },
-    "fileId": "93Am5mHrRODKgULg/ckpwt",
-    "sync": false,
-    "_synced": {
-      "default": false,
-      "serializable": false
-    }
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "Label",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 2
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 29
-      },
-      {
-        "__id__": 30
-      }
-    ],
-    "_prefab": {
-      "__id__": 31
-    },
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -950,7 +827,7 @@
     "_name": "Label<UITransformComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 28
+      "__id__": 24
     },
     "_enabled": true,
     "_priority": 0,
@@ -971,7 +848,7 @@
     "_name": "Label<LabelComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 28
+      "__id__": 24
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -1090,29 +967,29 @@
     },
     "_children": [
       {
-        "__id__": 36
+        "__id__": 32
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 40
+        "__id__": 36
       },
       {
-        "__id__": 41
+        "__id__": 37
       },
       {
-        "__id__": 42
+        "__id__": 38
       },
       {
-        "__id__": 43
+        "__id__": 39
       },
       {
-        "__id__": 44
+        "__id__": 40
       }
     ],
     "_prefab": {
-      "__id__": 45
+      "__id__": 41
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1147,20 +1024,20 @@
     "_name": "Layout",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 35
+      "__id__": 31
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 37
+        "__id__": 33
       },
       {
-        "__id__": 38
+        "__id__": 34
       }
     ],
     "_prefab": {
-      "__id__": 39
+      "__id__": 35
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1195,7 +1072,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 36
+      "__id__": 32
     },
     "_enabled": true,
     "_priority": 0,
@@ -1216,7 +1093,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 36
+      "__id__": 32
     },
     "_enabled": true,
     "_resizeMode": 1,
@@ -1259,7 +1136,7 @@
     "_name": "List<UITransformComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 35
+      "__id__": 31
     },
     "_enabled": true,
     "_priority": 0,
@@ -1280,7 +1157,7 @@
     "_name": "List<ScrollViewComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 35
+      "__id__": 31
     },
     "_enabled": true,
     "bounceDuration": 1,
@@ -1292,7 +1169,7 @@
     "cancelInnerEvents": true,
     "scrollEvents": [],
     "_content": {
-      "__id__": 36
+      "__id__": 32
     },
     "_horizontalScrollBar": null,
     "_verticalScrollBar": null,
@@ -1303,7 +1180,7 @@
     "_name": "List<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 35
+      "__id__": 31
     },
     "_enabled": true,
     "_alignFlags": 45,
@@ -1331,7 +1208,7 @@
     "_name": "List<MaskComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 35
+      "__id__": 31
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -1354,14 +1231,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 35
+      "__id__": 31
     },
     "_enabled": true,
     "scrollView": {
-      "__id__": 41
+      "__id__": 37
     },
     "content": {
-      "__id__": 36
+      "__id__": 32
     },
     "itemPrefab": {
       "__uuid__": "a5f7678b-ffd9-4c70-a9a7-35dc8fb9126b"
@@ -1369,7 +1246,6 @@
     "scrollType": 1,
     "autoScroll": true,
     "scrollSpeed": 70,
-    "dataCount": 20,
     "_id": ""
   },
   {
@@ -1417,10 +1293,10 @@
     },
     "_enabled": true,
     "scrollView": {
-      "__id__": 41
+      "__id__": 37
     },
     "content": {
-      "__id__": 36
+      "__id__": 32
     },
     "itemPrefab": {
       "__uuid__": "a35d4a29-693b-410b-bc10-5cce31760afd"
@@ -1428,7 +1304,6 @@
     "scrollType": 2,
     "autoScroll": true,
     "scrollSpeed": 50,
-    "dataCount": 9,
     "_id": ""
   },
   {

+ 26 - 20
assets/scripts/games/scenes/PrepareScene.ts

@@ -10,47 +10,53 @@ import BufferManager from '../../engines/buffers/BufferManager';
 import { PlatformManager } from '../../Platform/PlatformManager';
 import { WeChatPlatform } from '../../Platform/WeChat/WeChatPlatform';
 import { branchIdType } from '../../Platform/WeChat/branchIdType';
+import { LiangLiangSDK } from '../../libs/liangliangSDK';
 const { ccclass, property } = _decorator;
 
 @ccclass('PrepareScene')
 export class PrepareScene extends Component {
 
-    public static Inited:boolean=false;
-    
+    public static Inited: boolean = false;
+
     @property({
-        type:Prefab
+        type: Prefab
     })
-    TextNoticeView:Prefab=null;
+    TextNoticeView: Prefab = null;
 
-    start () {
+    start() {
         console.log("进入Prepare场景");
-        if(PrepareScene.Inited==false){
-            PrepareScene.Inited=true;
-            let canvas:Node=find("Canvas");
+        if (PrepareScene.Inited == false) {
+            PrepareScene.Inited = true;
+            let canvas: Node = find("Canvas");
             //UI全局节点
-            let uiRoot:Node=canvas.getChildByName("UIRoot");
-            let layerRoot:Node=uiRoot.getChildByName("LayerRoot");
-            let NoticeLayer:Node=uiRoot.getChildByName("NoticeLayer");
+            let uiRoot: Node = canvas.getChildByName("UIRoot");
+            let layerRoot: Node = uiRoot.getChildByName("LayerRoot");
+            let NoticeLayer: Node = uiRoot.getChildByName("NoticeLayer");
             LayerManager.single.Init(layerRoot);
 
             //提示
-            let noticeMap:Map<string,Prefab>=new Map<string,Prefab>();
-            noticeMap.set("Text",this.TextNoticeView);
-            NoticeManager.Init(NoticeLayer,noticeMap);
+            let noticeMap: Map<string, Prefab> = new Map<string, Prefab>();
+            noticeMap.set("Text", this.TextNoticeView);
+            NoticeManager.Init(NoticeLayer, noticeMap);
 
             UIConst.RegisterGUI();
         }
-        
+
         GUIManager.single.Show(UIConst.PREPARE_UI);
 
+
         let weChat = PlatformManager.impl as WeChatPlatform;
-            if(weChat instanceof WeChatPlatform){
-                weChat.branchAnalytics(branchIdType.EnterHall)
-            }
+        if (weChat instanceof WeChatPlatform) {
+            weChat.branchAnalytics(branchIdType.EnterHall)
+        }
+
+        if(LiangLiangSDK.CanWuChu() == true){
+            GUIManager.single.Show(UIConst.ADVERTISING_UI)
+        }
 
     }
-    
-    update (deltaTime: number) {
+
+    update(deltaTime: number) {
         GameModel.single.CheckEarnings();
         BufferManager.Tick(deltaTime);
     }

+ 12 - 0
assets/scripts/games/ui/UIConst.ts

@@ -63,6 +63,16 @@ export class UIConst extends Component {
      * 武器免费升级
      */
     public static FREE_UPGRADE_UI:number=11;
+
+    /**
+     * 热门推荐cpa
+     */
+    public static ADVERTISING_UI:number = 50;
+
+    /**
+     * 误触宝箱 免费神枪 cpa
+     */
+    public static FREE_USE_GUN_UI:number = 51;
     
     //注册所有游戏UI
     static RegisterGUI():void{
@@ -78,5 +88,7 @@ export class UIConst extends Component {
         GUIManager.single.RegisterGUI(this.SIGN_UI,"ui/SignInUI");
         GUIManager.single.RegisterGUI(this.DROP_BOX_UI,"ui/DropBoxUI");
         GUIManager.single.RegisterGUI(this.FREE_UPGRADE_UI,"ui/FreeUpgradeUI");
+        GUIManager.single.RegisterGUI(this.ADVERTISING_UI,"ui/ads/AdvertisingUI");
+        GUIManager.single.RegisterGUI(this.FREE_USE_GUN_UI,"ui/FreeUseGunUI");
     }
 }

+ 9 - 0
assets/scripts/games/ui/advertising.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "0.0.1",
+  "importer": "*",
+  "imported": true,
+  "uuid": "1452e0f9-b83c-439b-985d-a2907b3f5859",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 22 - 0
assets/scripts/games/ui/advertising/AdvertisingMediator.ts

@@ -0,0 +1,22 @@
+import { _decorator, Component, Node } from 'cc';
+import { GUIMediator } from '../../../engines/gui/GUIMediator';
+const { ccclass, property } = _decorator;
+
+@ccclass('AdvertisingMediator')
+export class AdvertisingMediator extends GUIMediator {
+    start () {
+        
+    }
+    
+    OnShow(data?:any):void{
+        
+    }
+
+    OnHide():void{
+        
+    }
+
+    private get wx():any{
+        return window["wx"];
+    }
+}

+ 15 - 0
assets/scripts/games/ui/advertising/AdvertisingMediator.ts.meta

@@ -0,0 +1,15 @@
+{
+  "ver": "2.0.14",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "13aaf68e-34a2-479a-938a-4c1c5d7979e6",
+  "files": [
+    ".js",
+    ".trans"
+  ],
+  "subMetas": {},
+  "userData": {
+    "importAsPlugin": false,
+    "moduleId": "project:///assets/scripts/games/ui/advertising/AdvertisingMediator.js"
+  }
+}