|
|
@@ -59569,6 +59569,7 @@ window.tourPlayCtl = {
|
|
|
class UserGuide{
|
|
|
constructor(player){
|
|
|
let lastCurItem
|
|
|
+ this.currentItem = [0,0]
|
|
|
this.player = player
|
|
|
this.pausedByBtn = true
|
|
|
|
|
|
@@ -59577,33 +59578,52 @@ class UserGuide{
|
|
|
});
|
|
|
player.on("flying.ended",(a,b,pano,d)=>{
|
|
|
//更新导览进度条 导览片段的选中与当前点位所属片段对应。
|
|
|
- player.director.setCurrentItem( player.director.findNearestItem(true,true) )
|
|
|
+ this.setCurrentItem( player.director.findNearestItem(true,true) )
|
|
|
|
|
|
})
|
|
|
|
|
|
- player.director.on("update.controls", ()=>{ //更新了currentItem的话
|
|
|
+ /* player.director.on("update.controls", ()=>{ //更新了currentItem的话
|
|
|
if(player.director.itemCompare(lastCurItem, player.director.currentItem,'equal' )) return
|
|
|
lastCurItem = player.director.currentItem?.slice()
|
|
|
|
|
|
if(!player.director.tourIsPlaying){
|
|
|
if(this.pausedByBtn) return
|
|
|
else this.play()
|
|
|
- }
|
|
|
- /* let folder = player.model.heroLocations[player.director.currentItem[0]]
|
|
|
- let items = folder.heroLocations ? folder.heroLocations : [folder]
|
|
|
- if(items.some(e=>e.panoId == player.currentPano.id)){ */
|
|
|
+ }
|
|
|
let curItem = player.model.getHeroDescriptorByIndex(player.director.currentItem)
|
|
|
if(player.currentPano.id == curItem.panoId){
|
|
|
this.setMusic()
|
|
|
}else{//走到了导览以外的区域
|
|
|
this.pause(false)//SoundManager.pause('tour')
|
|
|
}
|
|
|
- })
|
|
|
+ }) */
|
|
|
|
|
|
player.director.playTourNearBy = this.play.bind(this)
|
|
|
player.director.stopTour = this.pause.bind(this)
|
|
|
}
|
|
|
|
|
|
+ setCurrentItem(item){
|
|
|
+ if(player.director.itemCompare(item, this.currentItem,'equal' )) return
|
|
|
+ //lastCurItem = player.director.currentItem?.slice()
|
|
|
+
|
|
|
+
|
|
|
+ let curItem = player.model.getHeroDescriptorByIndex(item)
|
|
|
+ if(player.currentPano.id == curItem.panoId){
|
|
|
+ player.director.setCurrentItem(item)
|
|
|
+
|
|
|
+ //if(!player.director.tourIsPlaying){
|
|
|
+ if(this.pausedByBtn) return
|
|
|
+ else this.play()
|
|
|
+ //}
|
|
|
+ //this.setMusic()
|
|
|
+ }else{//走到了导览以外的区域
|
|
|
+ player.director.setCurrentItem(null)
|
|
|
+ this.pause(false)//SoundManager.pause('tour')
|
|
|
+ }
|
|
|
+
|
|
|
+ this.currentItem = item
|
|
|
+ }
|
|
|
+
|
|
|
play(){
|
|
|
//从当前index开始播放,如果在导览区域,就在当前点播音乐,如果不是就跳到当前导览区域第一个点
|
|
|
//假定导览都在漫游模式 //假设不同导览区域不存在相同漫游点
|