future 1 年之前
父节点
当前提交
571793831f

+ 28 - 74
assets/run/ani/fail_ani.anim

@@ -8,7 +8,7 @@
     },
     "_native": "",
     "sample": 60,
-    "speed": 5,
+    "speed": 3,
     "wrapMode": 1,
     "enableTrsBlending": false,
     "_duration": 0.8,
@@ -104,7 +104,7 @@
         "__type__": "cc.RealKeyframeValue",
         "interpolationMode": 0,
         "tangentWeightMode": 0,
-        "value": 164.15,
+        "value": 164.14999389648438,
         "rightTangent": 0,
         "rightTangentWeight": 1,
         "leftTangent": 0,
@@ -128,15 +128,13 @@
         "__type__": "cc.RealKeyframeValue",
         "interpolationMode": 0,
         "tangentWeightMode": 0,
-        "value": -600,
+        "value": -1100,
         "rightTangent": 0,
         "rightTangentWeight": 1,
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       }
     ],
     "preExtrapolation": 1,
@@ -173,7 +171,7 @@
         "__type__": "cc.RealKeyframeValue",
         "interpolationMode": 0,
         "tangentWeightMode": 0,
-        "value": 174.101,
+        "value": 174.1009979248047,
         "rightTangent": 0,
         "rightTangentWeight": 1,
         "leftTangent": 0,
@@ -197,15 +195,13 @@
         "__type__": "cc.RealKeyframeValue",
         "interpolationMode": 0,
         "tangentWeightMode": 0,
-        "value": -700,
+        "value": -1200,
         "rightTangent": 0,
         "rightTangentWeight": 1,
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       }
     ],
     "preExtrapolation": 1,
@@ -272,9 +268,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       }
     ],
     "preExtrapolation": 1,
@@ -453,9 +447,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -467,9 +459,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -481,9 +471,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -495,9 +483,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -509,9 +495,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       }
     ],
     "preExtrapolation": 1,
@@ -543,9 +527,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -557,9 +539,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -571,9 +551,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -585,9 +563,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -599,9 +575,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       }
     ],
     "preExtrapolation": 1,
@@ -633,9 +607,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -647,9 +619,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -661,9 +631,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -675,9 +643,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -689,9 +655,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       }
     ],
     "preExtrapolation": 1,
@@ -723,9 +687,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -737,9 +699,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -751,9 +711,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -765,9 +723,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       },
       {
         "__type__": "cc.RealKeyframeValue",
@@ -779,9 +735,7 @@
         "leftTangent": 0,
         "leftTangentWeight": 1,
         "easingMethod": 0,
-        "__editorExtras__": {
-          "tangentMode": 0
-        }
+        "__editorExtras__": null
       }
     ],
     "preExtrapolation": 1,

+ 19 - 19
assets/scene/game.scene

@@ -93,7 +93,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 540,
-      "y": 960.0000000000002,
+      "y": 960,
       "z": 0
     },
     "_lrot": {
@@ -178,7 +178,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 960.0000000000001,
+    "_orthoHeight": 960,
     "_near": 0,
     "_far": 1000,
     "_color": {
@@ -344,7 +344,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -648,7 +648,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1158,7 +1158,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -2007,7 +2007,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -4178,7 +4178,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -4239,7 +4239,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": -540,
-      "y": -960.0000000000001,
+      "y": -960,
       "z": 0
     },
     "_lrot": {
@@ -4278,7 +4278,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -4801,7 +4801,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 860.0000000000001,
+      "y": 860,
       "z": 0
     },
     "_lrot": {
@@ -5611,7 +5611,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -5811,7 +5811,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": -540,
-      "y": -960.0000000000001,
+      "y": -960,
       "z": 0
     },
     "_lrot": {
@@ -5850,7 +5850,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -6607,7 +6607,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -11108,7 +11108,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -18334,7 +18334,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -18427,7 +18427,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -18548,7 +18548,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -18663,7 +18663,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

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

@@ -311,6 +311,16 @@ export class gameManager extends Component {
         ClientEvent.dispatchEvent(config.EventRun.ON_WIN)
     }
 
+    public gotoGameLevel() {
+        console.log('进入游戏关卡 进入游戏关卡')
+        SdkUtil.ttStartScreenRecording()
+    }
+
+    public gameLevelSuccessBackGameList() {
+        console.log('游戏关卡成功返回游戏列表 游戏关卡成功返回游戏列表 游戏关卡成功返回游戏列表')
+        gameManager.Singleton.backGameList()
+    }
+
     public backGameList(){
         if(!gameManager.isLoadingStatus){
             this.unscheduleAllCallbacks()
@@ -319,6 +329,10 @@ export class gameManager extends Component {
         }else{
             console.log("没有全部加载完成!")
         }
+
+        SdkUtil.ttStopScreenRecording()
+        // let videoPath = SdkUtil.ttGetScreenRecordingVideoPath()
+        // console.log('录制视频的路径=',videoPath)
     }
 
     public initEvent(){

+ 1 - 0
assets/script/run/game_list_view/game_list.ts

@@ -216,6 +216,7 @@ export class game_list extends Component {
                             gameManager.Singleton.setLevelData(item.getData())
                             gameManager.Singleton.runGame(_data.content.content)
                             gameManager.Singleton.hideLoadingLevel()
+                            gameManager.Singleton.gotoGameLevel()
                             this.hide()
                         })
                   

+ 0 - 1
assets/script/run/loading_view/loading_view.ts

@@ -92,7 +92,6 @@ export class loading_view extends Component {
                                             console.log("_data",_data)
                                             login_call_back();
                                         }
-                                       
                                     })
                                 },
                                 fail(res) {

+ 1 - 1
assets/script/run/ui/win.ts

@@ -31,7 +31,7 @@ export class win extends Component {
         })
         this.btn_close.on(Node.EventType.TOUCH_END,()=>{
             this.node.active = false;
-            gameManager.Singleton.backGameList()
+            gameManager.Singleton.gameLevelSuccessBackGameList()
             this.icon.getComponent(Sprite).spriteFrame = null
         })
 

+ 83 - 8
assets/script/sdkUtil.ts

@@ -22,6 +22,11 @@ export class SdkUtil {
     public static tt_isSupportSidebar:boolean = false;   //抖音_是否支持侧边栏
     public static tt_isToEnterFromSidebar:boolean = false; //抖音_是否从侧边栏进入
 
+    private static ttGameRecorder:any = null;      //抖音游戏录制
+    private static ttRecordVideoPath:string = '';  //抖音录制视频路径
+    private static ttTotalRecord:number = 300;     //抖音总录制时间
+    private static ttIsRecording:boolean = false;  //抖音是否录制中
+
     /**
        * 自定义事件统计
        *
@@ -102,7 +107,7 @@ export class SdkUtil {
 
     
     /**
-     * 抖音激励视频
+     * 抖音/微信激励视频
      * 
      * @static
      * @param {string} _adUnitId
@@ -120,14 +125,16 @@ export class SdkUtil {
             if(sys.platform==sys.Platform.BYTEDANCE_MINI_GAME) {
                 SdkUtil.videoAd = tt.createRewardedVideoAd({adUnitId: _adUnitId});
             } else if(sys.platform==sys.Platform.WECHAT_GAME) {
+                gameManager.Singleton.hideLoadingLevel()
                 call_back({"isEnded":true})
+                return
                 // SdkUtil.videoAd = wx.createRewardedVideoAd({adUnitId: _adUnitId});
             }
 
             if(SdkUtil.videoAd==null){ 
                 return
              }
-             
+
             SdkUtil.videoAd.onLoad(() => {
                 SdkUtil.videoAd.show();
                 console.log("广告加载完成");
@@ -212,17 +219,85 @@ export class SdkUtil {
         }
     }
 
-    /**
-     * 抖音开启屏幕录制
-     */
+    // 抖音开启屏幕录制
     public static ttStartScreenRecording() {
+        return
+        if(sys.platform!=sys.Platform.BYTEDANCE_MINI_GAME) {
+            return
+        }
 
+        if(this.ttIsScreenRecording()==true) {
+            this.ttStopScreenRecording()
+        }
+        
+        this.ttIsRecording = true
+        if(!this.ttGameRecorder) {
+            this.ttGameRecorder = tt.getGameRecorderManager()
+        }
+        this.ttGameRecorder.start({duration: this.ttTotalRecord})
+        this.ttGameRecorder.onStart(()=> {
+            console.log('GameRecorder onStart onStart onStart')
+        })
+        this.ttGameRecorder.onStop((res)=> {
+            console.log('GameRecorder onStop onStop onStop=',res)
+            this.ttIsRecording = false
+            this.ttRecordVideoPath = res.videoPath
+            SdkUtil.ttShareScreenRecordVideo('测试测试',res.videoPath)
+        })
+        this.ttGameRecorder.onError((e)=> {
+            console.log('ttGameRecord error:',e)
+        })
     }
 
-    /**
-     * 抖音关闭屏幕录制
-     */
+    // 抖音关闭屏幕录制
     public static ttStopScreenRecording() {
+        return
+        if(sys.platform!=sys.Platform.BYTEDANCE_MINI_GAME) {
+            return
+        }
+
+        if(this.ttGameRecorder == null) {
+            return
+        }
+        
+        this.ttGameRecorder.stop()        
+    }
 
+    // 抖音是否屏幕录制
+    public static ttIsScreenRecording():boolean {
+        return this.ttIsRecording;
+    }
+
+    // 抖音获取屏幕录制视频文件
+    public static ttGetScreenRecordingVideoPath():string {
+        return this.ttRecordVideoPath;
+    }
+
+    // 抖音分享屏幕录制视频
+    public static ttShareScreenRecordVideo(title: string, videoPath: string, onSuccess: Function = null, onFail: Function = null) {
+        tt.shareAppMessage({
+            title: title,
+            channel: "video",
+            extra: {
+                videoTopics: [],
+                hashtag_list: [],
+                videoPath: videoPath,
+                withVideoId: true,
+            },
+            success: (res) => {
+                console.log('抖音分享屏幕录制视频,成功=',res)
+                onSuccess && onSuccess();
+            },
+            fail: (e) => {
+                console.log('抖音分享屏幕录制视频,失败=',e)
+                // if(this.checkAppName()){
+                //     onSuccess && onSuccess();
+                // }else{
+                //     onFail && onFail();
+                // }
+                // 当前今日头条ios无法获得分享成功回调 if(res.platform === 'ios' && res.appName === 'Toutiao')
+                onFail && onFail()
+            }
+        })
     }
 }