Prechádzať zdrojové kódy

fix: 调整 window.bus.dispatchEvent({type:'playerAndModelReady'}) 到modeTran赋值之后

xzw 3 rokov pred
rodič
commit
8fc21a9a2c
3 zmenil súbory, kde vykonal 12 pridanie a 12 odobranie
  1. 3 3
      js/main_2020_edit.js
  2. 4 4
      js/main_2020_show.js
  3. 5 5
      js/manage.js

+ 3 - 3
js/main_2020_edit.js

@@ -20218,7 +20218,7 @@ function o(a, s, l) {
                 this.preRenderingEnabled = !1,
                 this.setupCustomProperties(e),
                 this.zoomStats = new v,
-                this.modeTran = 'dollhouse-panorama'
+                this.modeTran = ''//'dollhouse-panorama'
                 this.currentCursor = '';
                 window.player = this 
                 
@@ -22259,7 +22259,7 @@ function o(a, s, l) {
                 
                 this.emit(W.ModeChanging, u, i, n, p)
                 n && (this.currentPano = n)
-                window.bus.dispatchEvent({type:'playerAndModelReady'}) 
+                
                 
                 
                 this.switchCameraMode(i, l)
@@ -22287,7 +22287,7 @@ function o(a, s, l) {
                 }else{  
                     this.transitionPos({type:"beforeFlyOut",  dur:p/2})//add                       
                 }
-            
+                window.bus.dispatchEvent({type:'playerAndModelReady'}) 
             
                 
                 if (i === V.PANORAMA)

+ 4 - 4
js/main_2020_show.js

@@ -21350,7 +21350,7 @@ window.Modernizr = function(n, e, t) {
                 this.setupCustomProperties(e),
                 this.zoomStats = new L
                 window.player = this
-                
+                this.modeTran = ''
                 
             }
             var r = e("three")
@@ -21425,7 +21425,7 @@ window.Modernizr = function(n, e, t) {
                 this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
                 this.bindEvents(e.container),
                 this.updateModel()
-                this.modeTran = ''
+                
                 
                 
             }
@@ -23480,7 +23480,7 @@ window.Modernizr = function(n, e, t) {
                 n && (this.currentPano = n),
                 this.switchCameraMode(i, c),
                 y.cancelById(V.LookTransition);
-                window.bus.dispatchEvent({type:'playerAndModelReady'}) 
+                
                 
                 
                  //before fly---------------------
@@ -23500,7 +23500,7 @@ window.Modernizr = function(n, e, t) {
                 }else{  
                     this.transitionPos({type:"beforeFlyOut",  dur:I/2})//add                       
                 }
-                
+                window.bus.dispatchEvent({type:'playerAndModelReady'}) 
                 //------------------------------------
                 
                 

+ 5 - 5
js/manage.js

@@ -1416,17 +1416,17 @@ function initByTHREE(THREE){
         init(){
             super.init()
             //飞入后不可见
-            player.on("mode.changing",(currentMode, mode, pano, duration)=>{//准备飞
-                this.setStyle(currentMode, mode, duration)
+            player.on("mode.changing",(oldMode, mode, pano, duration)=>{//准备飞
+                this.setStyle(oldMode, mode, duration)
             })
             this.setStyle()   
         } 
          
-        setStyle(currentMode, mode, duration){
-            if(!mode) mode = player.mode
+        setStyle(oldMode, mode, duration){
+            if(!mode) mode = player.modeTran.split('-')[1] || player.mode //要变成的mode或当前mode
             if(mode == 'panorama'){
                 this.setVisible(false, 'isPanorama')
-            }else if(currentMode == 'panorama'){
+            }else if(oldMode == 'panorama'){
                 setTimeout(()=>{
                     this.setVisible(true, 'isPanorama')
                 },duration*0.7)