Commit 09551666 authored by wildfirecode's avatar wildfirecode

1

parent 343dd45f
...@@ -84,12 +84,14 @@ export enum SoundType { ...@@ -84,12 +84,14 @@ export enum SoundType {
bonusShoot = 'bonusShoot', bonusShoot = 'bonusShoot',
bonusTime = 'haha', bonusTime = 'haha',
} }
export const playSound = async (type: SoundType) => {
export const playSound = (type: SoundType) => {
if (!soundOn) return; if (!soundOn) return;
const sound: egret.Sound = RES.getRes(type + "_mp3"); const sound: egret.Sound = RES.getRes(type + "_mp3");
if (sound) if (sound) {
sound.play(0, 1);
}
else {
const sound = await RES.getResAsync(type + "_mp3");
sound.play(0, 1); sound.play(0, 1);
else }
RES.getResAsync(type + "_mp3")
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment