future há 1 ano atrás
pai
commit
525f1d9ad7

+ 20 - 20
assets/scene/game.scene

@@ -93,7 +93,7 @@
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
       "x": 540,
       "x": 540,
-      "y": 960,
+      "y": 960.0000000000002,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {
@@ -178,7 +178,7 @@
     "_priority": 0,
     "_priority": 0,
     "_fov": 45,
     "_fov": 45,
     "_fovAxis": 0,
     "_fovAxis": 0,
-    "_orthoHeight": 960,
+    "_orthoHeight": 960.0000000000001,
     "_near": 0,
     "_near": 0,
     "_far": 1000,
     "_far": 1000,
     "_color": {
     "_color": {
@@ -347,7 +347,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -651,7 +651,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -1167,7 +1167,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -2016,7 +2016,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -4193,7 +4193,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -4254,7 +4254,7 @@
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
       "x": -540,
       "x": -540,
-      "y": -960,
+      "y": -960.0000000000001,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {
@@ -4293,7 +4293,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -5132,7 +5132,7 @@
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
       "x": 0,
       "x": 0,
-      "y": 860,
+      "y": 860.0000000000001,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {
@@ -5514,7 +5514,7 @@
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
       "x": -421,
       "x": -421,
-      "y": 818,
+      "y": 818.0000000000001,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {
@@ -9103,7 +9103,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -9309,7 +9309,7 @@
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
       "x": -540,
       "x": -540,
-      "y": -960,
+      "y": -960.0000000000001,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {
@@ -9348,7 +9348,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -14882,7 +14882,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -24319,7 +24319,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -24412,7 +24412,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -24581,7 +24581,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -24633,7 +24633,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -24754,7 +24754,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1080,
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",

+ 9 - 3
assets/script/run/gameManager.ts

@@ -29,6 +29,7 @@ export class gameManager extends Component {
     private static isLoadingStatus:boolean = false;
     private static isLoadingStatus:boolean = false;
     public static lookVideoAdsNumber:number = 0;
     public static lookVideoAdsNumber:number = 0;
     public static isTestUser:boolean = false;
     public static isTestUser:boolean = false;
+    public static isPlayGameLevelMusic:boolean = false;
     @property(sceneManager) mSceneManager:sceneManager = null;
     @property(sceneManager) mSceneManager:sceneManager = null;
     @property(sysSound) mSysSound:sysSound = null;
     @property(sysSound) mSysSound:sysSound = null;
     protected start(): void {
     protected start(): void {
@@ -345,7 +346,8 @@ export class gameManager extends Component {
         if(!gameManager.isLoadingStatus){
         if(!gameManager.isLoadingStatus){
             this.unscheduleAllCallbacks()
             this.unscheduleAllCallbacks()
             this.mGameRun.backGameList()
             this.mGameRun.backGameList()
-            gameManager.Singleton.mSceneManager.play_music()
+            gameManager.Singleton.mSceneManager.play_sys_music()
+            gameManager.isPlayGameLevelMusic = false
 
 
             SdkUtil.ttStopScreenRecording(true)
             SdkUtil.ttStopScreenRecording(true)
             if(status == config.BACK_GAME_STATUS.WIN) {
             if(status == config.BACK_GAME_STATUS.WIN) {
@@ -449,8 +451,12 @@ export class gameManager extends Component {
         this.scheduleOnce(()=>{
         this.scheduleOnce(()=>{
             this.startGame()
             this.startGame()
         },0.5)
         },0.5)
-        if(gameManager.Singleton.getLevelData()){
-            // this.mSceneManager.playMusic(this.mLevelData.piped_music,true)
+        if(gameManager.isPlayGameLevelMusic==false) {
+            gameManager.isPlayGameLevelMusic = true
+            if(gameManager.Singleton.getLevelData()){
+                this.mSceneManager.stopMusic()
+                this.mSceneManager.playMusic(this.mLevelData.piped_music,true)
+            }
         }
         }
     }
     }
 
 

+ 8 - 6
assets/script/run/sceneManager.ts

@@ -40,7 +40,7 @@ export class sceneManager extends Component {
         let call_back = (err: any, clip: AudioClip)=> {
         let call_back = (err: any, clip: AudioClip)=> {
             if(!err){
             if(!err){
                 gameManager.mp3_cache.set(path,clip)
                 gameManager.mp3_cache.set(path,clip)
-                this.playClip(clip); 
+                this.playClip(clip, loop); 
             }
             }
         }
         }
         if(gameManager.mp3_cache.get(path)){
         if(gameManager.mp3_cache.get(path)){
@@ -50,9 +50,9 @@ export class sceneManager extends Component {
             assetManager.loadRemote(path, call_back );
             assetManager.loadRemote(path, call_back );
         }
         }
     }
     }
-    public playClip (clip: AudioClip) {
+    public playClip (clip: AudioClip, loop:boolean=true) {
         this.getSound().stop()
         this.getSound().stop()
-        this.getSound().loop = true;
+        this.getSound().loop = loop;
         this.getSound().clip = clip;
         this.getSound().clip = clip;
         if(gameManager.getUserData().isOpenYinYue){
         if(gameManager.getUserData().isOpenYinYue){
             this.getSound().play()
             this.getSound().play()
@@ -67,9 +67,12 @@ export class sceneManager extends Component {
         if(this.getSound().clip!=null){
         if(this.getSound().clip!=null){
             this.playClip(this.getSound().clip); 
             this.playClip(this.getSound().clip); 
         }else{
         }else{
-            gameManager.Singleton.getSceneManager().playMusic(gameManager.getSysData().content.sys_piped_music,true)
+            this.play_sys_music()
         }
         }
-    
+    }
+
+    public play_sys_music() {
+        gameManager.Singleton.getSceneManager().playMusic(gameManager.getSysData().content.sys_piped_music,true)
     }
     }
 
 
     getSound(){
     getSound(){
@@ -106,7 +109,6 @@ export class sceneManager extends Component {
         if(this.mPageList.length<=0){
         if(this.mPageList.length<=0){
             throw "不可以为空"
             throw "不可以为空"
         }else{
         }else{
-            this.stopMusic()
             this.mGameManager.loadSceneTask(data._task_data)
             this.mGameManager.loadSceneTask(data._task_data)
             this.mGameManager.loadScene(this.mPageList,data.type)
             this.mGameManager.loadScene(this.mPageList,data.type)
             for (let index = 0; index < data.page_list.length; index++) {
             for (let index = 0; index < data.page_list.length; index++) {