游戏结束射箭不再播放声音
This commit is contained in:
@@ -45,6 +45,7 @@ const currentSound = ref("");
|
|||||||
const currentRound = ref(props.currentRound);
|
const currentRound = ref(props.currentRound);
|
||||||
const currentRoundEnded = ref(!props.battleId);
|
const currentRoundEnded = ref(!props.battleId);
|
||||||
const halfTimeTip = ref(false);
|
const halfTimeTip = ref(false);
|
||||||
|
const ended = ref(false);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.tips,
|
() => props.tips,
|
||||||
@@ -128,7 +129,7 @@ const updateSound = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function onReceiveMessage(messages = []) {
|
async function onReceiveMessage(messages = []) {
|
||||||
if (!sound.value) return;
|
if (!sound.value || ended.value) return;
|
||||||
messages.forEach((msg) => {
|
messages.forEach((msg) => {
|
||||||
if (
|
if (
|
||||||
(props.battleId && msg.constructor === MESSAGETYPES.ShootResult) ||
|
(props.battleId && msg.constructor === MESSAGETYPES.ShootResult) ||
|
||||||
@@ -154,6 +155,10 @@ async function onReceiveMessage(messages = []) {
|
|||||||
audioManager.play("比赛结束");
|
audioManager.play("比赛结束");
|
||||||
} else if (msg.constructor === MESSAGETYPES.FinalShoot) {
|
} else if (msg.constructor === MESSAGETYPES.FinalShoot) {
|
||||||
audioManager.play("决金箭轮");
|
audioManager.play("决金箭轮");
|
||||||
|
} else if (msg.constructor === MESSAGETYPES.ShootSyncMePracticeID) {
|
||||||
|
ended.value = true;
|
||||||
|
} else if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||||
|
ended.value = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user