future hai 1 ano
pai
achega
b936fb0539
Modificáronse 3 ficheiros con 16 adicións e 16 borrados
  1. 1 1
      assets/scene/main.scene
  2. 12 0
      assets/script/GameManager.ts
  3. 3 15
      assets/script/game/game.ts

+ 1 - 1
assets/scene/main.scene

@@ -290,7 +290,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 959.9999999999999,
+    "_orthoHeight": 960,
     "_near": 0,
     "_far": 1000,
     "_color": {

+ 12 - 0
assets/script/GameManager.ts

@@ -57,6 +57,18 @@ export class GameManager extends Component {
         })
     }
 
+    // 游戏开始
+    public static gameStart() {
+        SdkUtil.ttStartScreenRecording()
+    }
+
+    // 游戏结束
+    public static gameOver() {
+        setTimeout(()=>{
+            SdkUtil.ttStopScreenRecording()
+        },1700)
+    }
+
     // 设置
     public static getSettingData():settingData {
         if(GameManager.settingData!=null) {

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

@@ -20,8 +20,7 @@ import { weiqi_manager } from './effect/weiqi_manager';
 import { cheyin_manager } from './cheyin/cheyin_manager';
 import { boom_manager } from './boom/boom_manager';
 import { qiyou_manager } from './qiyou_manager';
-
-import { SdkUtil } from '../sdkUtil';
+import { GameManager } from '../GameManager';
 const { ccclass, property } = _decorator;
 
 @ccclass('game')
@@ -97,7 +96,7 @@ export class game extends Component {
         //     }
         // },this)
 
-        this.onTTStartRecordVideo()
+        GameManager.gameStart()
     }
 
     public isOut(pos:Vec3){
@@ -137,7 +136,6 @@ export class game extends Component {
         director.once(Director.EVENT_AFTER_DRAW,()=>{
             this.removeAll()
             this.results_view.getComponent(results).show(this.car.getComponent(car).getScores(),(()=>{
-                this.onTTStopRecordVideo()
             }), (isReLife:boolean=false)=>{
                 this.show(this.mCallBackHome,isReLife)
             },()=>{
@@ -145,17 +143,7 @@ export class game extends Component {
                 this.mCallBackHome()
             },!this.car.getComponent(car).getIsReLife())
         })
-   
-    }
-
-    private onTTStartRecordVideo() {
-        SdkUtil.ttStartScreenRecording()
-    }
-
-    private onTTStopRecordVideo() {
-        setTimeout(()=>{
-            SdkUtil.ttStopScreenRecording()
-        },1500)
+        GameManager.gameOver()
     }
 
     removeSelf(){