future пре 1 година
родитељ
комит
d9a6c0f9d5

+ 3 - 3
assets/resources/ui/car_lib.prefab

@@ -2620,7 +2620,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 10,
-      "y": -28.710000000000036,
+      "y": -91.71000000000004,
       "z": 0
     },
     "_lrot": {
@@ -2660,8 +2660,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 634,
-      "height": 632
+      "width": 1080,
+      "height": 600
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 2 - 2
assets/resources/ui/car_lib_list_item.prefab

@@ -139,8 +139,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 634,
-      "height": 632
+      "width": 1080,
+      "height": 600
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 12 - 15
assets/resources/ui/home.prefab

@@ -4048,8 +4048,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 634,
-      "height": 632
+      "width": 636,
+      "height": 424
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -4084,10 +4084,7 @@
       "b": 255,
       "a": 255
     },
-    "_spriteFrame": {
-      "__uuid__": "5eb1145a-7c33-447f-bc30-83fe23f76e80@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
+    "_spriteFrame": null,
     "_type": 0,
     "_fillType": 0,
     "_sizeMode": 1,
@@ -4803,8 +4800,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 634,
-      "height": 632
+      "width": 1080,
+      "height": 600
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -5529,7 +5526,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 2,
-      "y": 58.536,
+      "y": 57.536,
       "z": 0
     },
     "_lrot": {
@@ -5541,8 +5538,8 @@
     },
     "_lscale": {
       "__type__": "cc.Vec3",
-      "x": 0.24,
-      "y": 0.24,
+      "x": 0.25,
+      "y": 0.25,
       "z": 1
     },
     "_mobility": 0,
@@ -5569,8 +5566,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 634,
-      "height": 632
+      "width": 1080,
+      "height": 600
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -6335,8 +6332,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 634,
-      "height": 632
+      "width": 1080,
+      "height": 600
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 14 - 8
assets/script/GameManager.ts

@@ -24,31 +24,37 @@ export class GameManager extends Component {
         return sf
     }
     
-    public static checkPlayGame(parent_node:Node,cb) {
+    public static checkPlayGame(parent_node:Node,play_cb) {
+        let call_back = (()=>{
+            play_cb()
+        })
         if(userDataManager.getUserIsFreeAds()) {
-            cb()
+            call_back()
             return
         }
         if(userDataManager.isTodayCanFreePlayGame()) {
             userDataManager.addTodayPlayGameNumber()
-            cb()
+            call_back()
             return
         }
 
         uiManager.Instance().showUi(config.UI.ui_restart_view, parent_node, (node:Node)=>{
-            node.getComponent(restart_view).initView(()=>{
+            node.getComponent(restart_view).initView((v:restart_view)=>{
                 GameManager.showVideoAd(config.ADS_TYPE.GAME_RESTART, ()=>{
-                    cb()
+                    v.closeSelf()
+                    call_back()
                 })
-            },()=>{
+            },(v:restart_view)=>{
                 if(userDataManager.isTodayCanShare()) {
                     userDataManager.addTodayShareNumber()
-                    cb()
+                    v.closeSelf()
+                    call_back()
                     return
                 }
                 SdkUtil.shareGame('',(r)=>{
                     if(r==true) {
-                        cb()
+                        v.closeSelf()
+                        call_back()
                     }
                 })
             })

+ 1 - 0
assets/script/config.ts

@@ -3,6 +3,7 @@ const { ccclass, property } = _decorator;
 
 @ccclass('config')
 export class config  {
+    static gameName = "开局自行车";
     public static Platform = {
         platform: "douyin",
         // platform: "wx"

+ 15 - 1
assets/script/game/game.ts

@@ -19,6 +19,7 @@ import { count_time_start } from './count_time_start';
 import { weiqi_manager } from './effect/weiqi_manager';
 import { cheyin_manager } from './cheyin/cheyin_manager';
 import { boom_manager } from './boom/boom_manager';
+import { SdkUtil } from '../sdkUtil';
 const { ccclass, property } = _decorator;
 
 @ccclass('game')
@@ -92,6 +93,7 @@ export class game extends Component {
             }
         },this)
 
+        this.onTTStartRecordVideo()
     }
 
     public showBoom(box_p:Vec3){
@@ -120,7 +122,9 @@ export class game extends Component {
         this.car.getComponent(car).hideEffect()
         director.once(Director.EVENT_AFTER_DRAW,()=>{
             this.removeAll()
-            this.results_view.getComponent(results).show(this.car.getComponent(car).getScores(),(isReLife:boolean=false)=>{
+            this.results_view.getComponent(results).show(this.car.getComponent(car).getScores(),(()=>{
+                this.onTTStopRecordVideo()
+            }), (isReLife:boolean=false)=>{
                 this.show(this.mCallBackHome,isReLife)
             },()=>{
                 this.removeSelf()
@@ -130,6 +134,16 @@ export class game extends Component {
    
     }
 
+    private onTTStartRecordVideo() {
+        SdkUtil.ttStartScreenRecording()
+    }
+
+    private onTTStopRecordVideo() {
+        setTimeout(()=>{
+            SdkUtil.ttStopScreenRecording()
+        },1500)
+    }
+
     removeSelf(){
         this.node.removeFromParent()
     }

+ 3 - 7
assets/script/game/results.ts

@@ -49,12 +49,7 @@ export class results extends base_ui {
         })
 
         this.onButtonListen(this.btn_share,()=>{
-            // SdkUtil.shareGame('',()=>{
-                // if(this.call_back){
-                //     this.call_back(true)
-                //     this.close()
-                // }
-            // })
+            SdkUtil.shareGameVideo()
          })
     }
 
@@ -62,7 +57,7 @@ export class results extends base_ui {
         this.node.active = false;
     }
 
-    public show(scores:number,call,back_home_cb,isReLife:boolean){
+    public show(scores:number,jiesuan_finish_cb,call,back_home_cb,isReLife:boolean){
         this.back_home_cb = back_home_cb
         this.btn_video_reLife.active = isReLife
         http.post(config.API.sync_integral,{"integral":scores},(err,data)=>{
@@ -89,6 +84,7 @@ export class results extends base_ui {
                 //     console.log("rankings",data)
                 // })
             }
+            jiesuan_finish_cb()
         })
         audioManager.Instance().playSound(config.AUDIO.win)
         this.node.active = true

+ 1 - 1
assets/script/manager/uiManager.ts

@@ -41,7 +41,7 @@ export class uiManager  {
         })
     }
 
-    public showLoading(title:string=''){
+    public showLoading(title:string='正在加载...'){
         if(this.loading_view!=null){
             SdkUtil.showLoading(title)
             this.loading_view.active = true

+ 42 - 35
assets/script/sdkUtil.ts

@@ -207,16 +207,17 @@ export class SdkUtil {
             call_back(true)
         }
     }
-    // public static shareGame(title: string, imageUrl: string, videoPath: string) {
-    //     if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
-    //         if(videoPath!="") {
-    //             // this.ttShareScreenRecordVideo(config.gameName,videoPath)
-    //         }
-    //     } else if(sys.platform == sys.Platform.WECHAT_GAME) {
-    //         title = title + '好刺激、好好玩'
-    //         // this.wxShare(title, imageUrl)
-    //     }
-    // }
+    public static shareGameVideo() {
+        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            let videoPath = SdkUtil.ttGetScreenRecordingVideoPath()
+            uiManager.Instance().showLoading()
+            this.ttShareScreenRecordVideo(config.gameName,videoPath,()=>{
+                uiManager.Instance().hideLoading()
+            }, ()=>{
+                uiManager.Instance().hideLoading()
+            })
+        }
+    }
 
     // 获取广告id
     public static getAdId(ad_type = config.ADS_TYPE.UNKNOWN):string {
@@ -265,17 +266,19 @@ export class SdkUtil {
             console.log("广告加载完成");
         });
         SdkUtil.videoAd.onClose((res) => {
-            call_back(res)
+            // console.log('广告关闭')
+            uiManager.Instance().hideLoading()
             SdkUtil.isLookAd = false
             SdkUtil.videoAd.destroy()
-            uiManager.Instance().hideLoading()
+            call_back(res)
         });
         SdkUtil.videoAd.onError((res) => {
-            let errorString = res.errCode + '-' + res.errMsg
-            call_back({isEnded:false,errorString:errorString})
+            // console.log('广告错误')
+            uiManager.Instance().hideLoading()
             SdkUtil.isLookAd = false
             SdkUtil.videoAd.destroy()
-            uiManager.Instance().hideLoading()
+            let errorString = res.errCode + '-' + res.errMsg
+            call_back({isEnded:false,errorString:errorString})
         });
         SdkUtil.videoAd.load()
     }
@@ -463,26 +466,30 @@ export class SdkUtil {
 
     // 抖音分享屏幕录制视频
     private static ttShareScreenRecordVideo(title: string, videoPath: string, onSuccess: Function = null, onFail: Function = null) {
-        // tt.shareAppMessage({
-        //     title: title,
-        //     templateId: config.TT_SHARE_TEMPLATEID,
-        //     channel: "video",
-        //     extra: {
-        //         videoTopics: [config.gameName],
-        //         hashtag_list: ['小游戏','小程序'],
-        //         videoPath: videoPath,
-        //         withVideoId: true,
-        //     },
-        //     success: (res) => {
-        //         console.log('抖音分享屏幕录制视频,成功=',res)
-        //         onSuccess && onSuccess();
-        //     },
-        //     fail: (e) => {
-        //         // 当前今日头条ios无法获得分享成功回调 if(res.platform === 'ios' && res.appName === 'Toutiao')
-        //         console.log('抖音分享屏幕录制视频,失败=',e)
-        //         onFail && onFail()
-        //     }
-        // })
+        console.log('tt_录制视频路径=',videoPath)
+        if(videoPath.length<=0) {
+            return
+        }
+        tt.shareAppMessage({
+            title: title,
+            templateId: config.TT_CONFIG.SHARE_RECORD_VIDEO_ID,
+            channel: "video",
+            extra: {
+                videoTopics: [config.gameName],
+                hashtag_list: ['小游戏','小程序'],
+                videoPath: videoPath,
+                withVideoId: true,
+            },
+            success: (res) => {
+                console.log('抖音分享屏幕录制视频,成功=',res)
+                onSuccess && onSuccess();
+            },
+            fail: (e) => {
+                // 当前今日头条ios无法获得分享成功回调 if(res.platform === 'ios' && res.appName === 'Toutiao')
+                console.log('抖音分享屏幕录制视频,失败=',e)
+                onFail && onFail()
+            }
+        })
     }
 
 }

+ 1 - 1
assets/script/ui/feedback/feedback.ts

@@ -46,7 +46,7 @@ export class feedback extends base_ui {
         let data = this.submit_node.getComponent(feedback_submit).getData()
         // console.log('submit data=',data)
         if(data!=null) {
-            uiManager.Instance().showLoading()
+            uiManager.Instance().showLoading('正在提交...')
             http.post(config.API.feedback, data, (err,d)=>{
                 uiManager.Instance().hideLoading()
                 if(!err){

+ 5 - 0
assets/script/ui/home/home_guangbo.ts

@@ -14,6 +14,11 @@ export class home_guangbo extends Component {
     init(data_list:guangboData[]) {
         this.data_list = data_list
         // console.log(this.data_list)
+        if(this.data_list.length==0) {
+            this.lab_content.getComponent(Label).getComponent(Label).string = ''
+            this.unscheduleAllCallbacks()
+            return
+        }
         this.cur_index = 0
         this.getContentText()
     }

+ 4 - 2
assets/script/ui/restart_view.ts

@@ -18,16 +18,18 @@ export class restart_view extends base_ui {
             if(this.m_look_video_cb){
                 this.m_look_video_cb(this)
             }
-            this.close()
         })
         this.onButtonListen(this.btn_share, ()=>{
             if(this.m_share_cb) {
                 this.m_share_cb(this)
             }
-            this.close()
         })
     }
 
+    public closeSelf() {
+        this.close()
+    }
+
     initView(look_video_cb,share_cb) {
         this.m_look_video_cb = look_video_cb
         this.m_share_cb = share_cb

BIN
assets/texture/car/home_car/1001.png


+ 27 - 27
assets/texture/car/home_car/1001.png.meta

@@ -39,17 +39,17 @@
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {
-        "trimType": "auto",
+        "trimType": "custom",
         "trimThreshold": 1,
         "rotated": false,
-        "offsetX": 0.5,
+        "offsetX": 0,
         "offsetY": 0,
-        "trimX": 1,
+        "trimX": 0,
         "trimY": 0,
-        "width": 634,
-        "height": 632,
-        "rawWidth": 635,
-        "rawHeight": 632,
+        "width": 1080,
+        "height": 600,
+        "rawWidth": 1080,
+        "rawHeight": 600,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -317,
-            -316,
+            -540,
+            -300,
             0,
-            317,
-            -316,
+            540,
+            -300,
             0,
-            -317,
-            316,
+            -540,
+            300,
             0,
-            317,
-            316,
+            540,
+            300,
             0
           ],
           "indexes": [
@@ -83,33 +83,33 @@
             3
           ],
           "uv": [
-            1,
-            632,
-            635,
-            632,
-            1,
             0,
-            635,
+            600,
+            1080,
+            600,
+            0,
+            0,
+            1080,
             0
           ],
           "nuv": [
-            0.0015748031496062992,
+            0,
             0,
             1,
             0,
-            0.0015748031496062992,
+            0,
             1,
             1,
             1
           ],
           "minPos": [
-            -317,
-            -316,
+            -540,
+            -300,
             0
           ],
           "maxPos": [
-            317,
-            316,
+            540,
+            300,
             0
           ]
         },

BIN
assets/texture/car/home_car/1002.png


+ 134 - 0
assets/texture/car/home_car/1002.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.26",
+  "importer": "image",
+  "imported": true,
+  "uuid": "161d902e-bfce-4e28-8b99-8f53f071c5d0",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "161d902e-bfce-4e28-8b99-8f53f071c5d0@6c48a",
+      "displayName": "1002",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "161d902e-bfce-4e28-8b99-8f53f071c5d0",
+        "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": "161d902e-bfce-4e28-8b99-8f53f071c5d0@f9941",
+      "displayName": "1002",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "custom",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 1080,
+        "height": 600,
+        "rawWidth": 1080,
+        "rawHeight": 600,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -540,
+            -300,
+            0,
+            540,
+            -300,
+            0,
+            -540,
+            300,
+            0,
+            540,
+            300,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            600,
+            1080,
+            600,
+            0,
+            0,
+            1080,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -540,
+            -300,
+            0
+          ],
+          "maxPos": [
+            540,
+            300,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "161d902e-bfce-4e28-8b99-8f53f071c5d0@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "161d902e-bfce-4e28-8b99-8f53f071c5d0@f9941"
+  }
+}