|
@@ -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++) {
|