添加声音连续播放
This commit is contained in:
@@ -22,26 +22,23 @@ const totalShot = ref(0);
|
||||
watch(
|
||||
() => tips.value,
|
||||
(newVal) => {
|
||||
let key = "";
|
||||
if (newVal.includes("重回")) return;
|
||||
if (newVal.includes("红队")) key = "请红方射箭";
|
||||
if (newVal.includes("蓝队")) key = "请蓝方射箭";
|
||||
if (!sound.value) return;
|
||||
let key = [];
|
||||
if (newVal.includes("重回")) return;
|
||||
if (currentRoundEnded.value) {
|
||||
currentRound.value += 1;
|
||||
// 播放当前轮次语音
|
||||
audioManager.play(
|
||||
`第${["一", "二", "三", "四", "五"][currentRound.value - 1]}轮`
|
||||
);
|
||||
key.push(`第${["一", "二", "三", "四", "五"][currentRound.value - 1]}轮`);
|
||||
}
|
||||
// 延迟播放队伍提示音
|
||||
setTimeout(
|
||||
() => {
|
||||
if (key) audioManager.play(newVal.includes("你") ? "轮到你了" : key);
|
||||
currentRoundEnded.value = false;
|
||||
},
|
||||
currentRoundEnded.value ? 1000 : 0
|
||||
key.push(
|
||||
newVal.includes("你")
|
||||
? "轮到你了"
|
||||
: newVal.includes("红队")
|
||||
? "请红方射箭"
|
||||
: "请蓝方射箭"
|
||||
);
|
||||
audioManager.play(key);
|
||||
currentRoundEnded.value = false;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user