声音播放规则修改

This commit is contained in:
kron
2025-08-27 18:23:59 +08:00
parent eb076df7d5
commit 01f05f4824
3 changed files with 46 additions and 12 deletions

View File

@@ -59,11 +59,13 @@ async function onReceiveMessage(messages = []) {
audioManager.play(currentSound.value);
}
} else if (msg.constructor === MESSAGETYPES.InvalidShot) {
uni.showToast({
title: "距离不足,无效",
icon: "none",
});
audioManager.play("射击无效");
if (msg.userId === user.value.id) {
uni.showToast({
title: "距离不足,无效",
icon: "none",
});
audioManager.play("射击无效");
}
} else if (msg.constructor === MESSAGETYPES.AllReady) {
currentRoundEnded.value = true;
audioManager.play("比赛开始");