|
@@ -161,7 +161,7 @@ class AudioChannel{
|
|
|
}
|
|
|
|
|
|
Play(soundUrl:string,isLoop:boolean):void{
|
|
|
- if(this.soundUrl==soundUrl){
|
|
|
+ if(this.soundUrl==soundUrl&&this.state==1){
|
|
|
return;
|
|
|
}
|
|
|
this.soundUrl=soundUrl;
|
|
@@ -194,9 +194,12 @@ class AudioChannel{
|
|
|
if(this.aSComponent==null){
|
|
|
return;
|
|
|
}
|
|
|
- this.aSComponent.stop();
|
|
|
- this.aSComponent.clip=audioClip;
|
|
|
+ if(this.aSComponent.clip!=audioClip){
|
|
|
+ this.aSComponent.stop();
|
|
|
+ this.aSComponent.clip=audioClip;
|
|
|
+ }
|
|
|
this.aSComponent.loop=this.isLoop;
|
|
|
+ this.aSComponent.currentTime=0;
|
|
|
this.aSComponent.play();
|
|
|
}
|
|
|
|