Skip to content

Commit e8200d5

Browse files
The function end() of AudioEngine should be a static function
1 parent 4dc929e commit e8200d5

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

CocosDenshion/SimpleAudioEngine.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,6 @@ cc.AudioEngine = cc.Class.extend(/** @lends cc.AudioEngine# */{
529529
}
530530
},
531531

532-
/**
533-
* Stop all music and sound effects
534-
* @example
535-
* //example
536-
* cc.AudioEngine.getInstance().end();
537-
*/
538-
end:function () {
539-
this.stopMusic();
540-
this.stopAllEffects();
541-
},
542-
543532
_getEffectList:function (elt) {
544533
if (this._effectList.hasOwnProperty(elt)) {
545534
return this._effectList[elt];
@@ -626,3 +615,18 @@ cc.AudioEngine.getInstance = function () {
626615
}
627616
return this._instance;
628617
};
618+
619+
620+
/**
621+
* Stop all music and sound effects
622+
* @example
623+
* //example
624+
* cc.AudioEngine.end();
625+
*/
626+
cc.AudioEngine.end = function () {
627+
if (this._instance) {
628+
this._instance.stopMusic();
629+
this._instance.stopAllEffects();
630+
}
631+
this._instance = null;
632+
};

0 commit comments

Comments
 (0)