future 1 year ago
parent
commit
602acb8f3b

BIN
assets/run/unlock_long_story_db.png


+ 134 - 0
assets/run/unlock_long_story_db.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.26",
+  "importer": "image",
+  "imported": true,
+  "uuid": "fea27bec-1aaf-45bd-a29c-aab4f2ad8ad5",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "fea27bec-1aaf-45bd-a29c-aab4f2ad8ad5@6c48a",
+      "displayName": "unlock_long_story_db",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "fea27bec-1aaf-45bd-a29c-aab4f2ad8ad5",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "fea27bec-1aaf-45bd-a29c-aab4f2ad8ad5@f9941",
+      "displayName": "unlock_long_story_db",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "auto",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 818,
+        "height": 768,
+        "rawWidth": 818,
+        "rawHeight": 768,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -409,
+            -384,
+            0,
+            409,
+            -384,
+            0,
+            -409,
+            384,
+            0,
+            409,
+            384,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            768,
+            818,
+            768,
+            0,
+            0,
+            818,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -409,
+            -384,
+            0
+          ],
+          "maxPos": [
+            409,
+            384,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "fea27bec-1aaf-45bd-a29c-aab4f2ad8ad5@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "fea27bec-1aaf-45bd-a29c-aab4f2ad8ad5@f9941"
+  }
+}

File diff suppressed because it is too large
+ 1028 - 176
assets/scene/game.scene


+ 4 - 0
assets/script/run/gameManager.ts

@@ -579,6 +579,10 @@ export class gameManager extends Component {
         this.mGameRun.showUnLockView(lock_one_call,lock_all_one_day)
     }
 
+    public showUnLockLongStoryView(lock_one_call) {
+        this.mGameRun.showUnLockLongStoryView(lock_one_call)
+    }
+
     public static getWidgetList(scene_data:scene_item_data):widget_item_data[]{
         let temp:widget_item_data[] = []
         for (let index = 0; index < scene_data.page_widget_list.length; index++) {

+ 15 - 3
assets/script/run/game_list_view/long_story_list.ts

@@ -7,6 +7,8 @@ import { long_story_list_item } from './long_story_list_item';
 import { gameManager } from '../gameManager';
 import { tools } from '../../tools';
 import { ClientEvent } from '../../clientEvent';
+import { unLock_long_story_view } from '../unLock_long_story_view/unLock_long_story_view';
+import { statisticsManager } from '../../statisticsManager';
 const { ccclass, property } = _decorator;
 
 @ccclass('long_story_list')
@@ -232,9 +234,19 @@ export class long_story_list extends Component {
                 call()
             }
         } else {
-            console.log('没有解锁了 看广告')
-            gameManager.Singleton.unLockLevel(level_item_data.id)
-            item.updateLockStatus(level_index,true)
+            gameManager.Singleton.showUnLockLongStoryView((view:unLock_long_story_view)=>{
+                let ad_id = SdkUtil.getAdId(config.AD_TYPE.UN_LOCK)
+                SdkUtil.showVideoAd(ad_id,(res)=>{
+                    if(res.isEnded){
+                        gameManager.Singleton.unLockLevel(level_item_data.id)
+                        item.updateLockStatus(level_index,true)
+                        view.close()
+                    }
+                    // 统计-激励视频广告
+                    let collect_data = statisticsManager.get_collect_ads_data(level_item_data.id, res, config.STATISTICS_ACTION_TYPE.TI_QIAN_JIE_SUO)
+                    statisticsManager.request_collect_rewardVideoData(collect_data)
+                })
+            })
         }
     }
 

+ 6 - 0
assets/script/run/game_run.ts

@@ -14,6 +14,7 @@ import { game_health_view } from './game_health_view/game_health_view';
 import { zb_login_view } from './zb_login_view/zb_login_view';
 import { scene_page } from './scene_page';
 import { tools } from '../tools';
+import { unLock_long_story_view } from './unLock_long_story_view/unLock_long_story_view';
 const { ccclass, property } = _decorator;
 
 @ccclass('game_run')
@@ -31,6 +32,7 @@ export class game_run extends Component {
     @property(Node) loading_level:Node = null;
     @property(Node) check_open:Node = null;
     @property(Node) unLock_view:Node = null;
+    @property(Node) unLock_long_story_view:Node = null;
     @property(Node) zb_login_view:Node = null;
     @property(Node) top_floor_layer:Node = null;
     @property(gameManager) mGameManger:gameManager = null;
@@ -63,6 +65,10 @@ export class game_run extends Component {
         this.unLock_view.getComponent(unLock_view).show(lock_one_call,lock_all_one_day)
     }
 
+    public showUnLockLongStoryView(lock_one_call) {
+        this.unLock_long_story_view.getComponent(unLock_long_story_view).show(lock_one_call)
+    }
+
     public runAll(){
         if(this.node.active==false) {
             this.node.active = true

+ 9 - 0
assets/script/run/unLock_long_story_view.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "d566d17f-a13a-42e1-aae8-ea299c4e437f",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 30 - 0
assets/script/run/unLock_long_story_view/unLock_long_story_view.ts

@@ -0,0 +1,30 @@
+import { _decorator, Component, Node } from 'cc';
+import { gameManager } from '../gameManager';
+const { ccclass, property } = _decorator;
+
+@ccclass('unLock_long_story_view')
+export class unLock_long_story_view extends Component {
+    @property(Node) btn_close:Node = null;
+    @property(Node) btn_video:Node = null;
+    private m_lock_one_call = null;
+    start() {
+        this.btn_close.on(Node.EventType.TOUCH_END,()=>{
+            gameManager.Singleton.sys_click_button_music()
+            this.close()
+        })
+        this.btn_video.on(Node.EventType.TOUCH_END,()=>{
+            gameManager.Singleton.sys_click_button_music()
+            this.m_lock_one_call && this.m_lock_one_call(this)
+        })
+    }
+
+    public show(lock_one_call){
+        this.node.active = true;
+        this.m_lock_one_call = lock_one_call
+    }
+
+    public close() {
+        this.node.active = false
+    }
+}
+

+ 9 - 0
assets/script/run/unLock_long_story_view/unLock_long_story_view.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "2c786f6d-18e8-4b4f-90a5-d1632fb0ad9b",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

Some files were not shown because too many files changed in this diff