更新音频
This commit is contained in:
@@ -33,6 +33,7 @@ const updateTimer = (value) => {
|
||||
count.value = Math.round(value);
|
||||
};
|
||||
onMounted(() => {
|
||||
audioManager.play("请射箭测试距离");
|
||||
timer.value = setInterval(() => {
|
||||
if (count.value > 0) count.value -= 1;
|
||||
else clearInterval(timer.value);
|
||||
@@ -51,10 +52,10 @@ async function onReceiveMessage(messages = []) {
|
||||
power.value = msg.target.battery;
|
||||
distance.value = Number((msg.target.dst / 100).toFixed(2));
|
||||
debugInfo.value = msg.target;
|
||||
audioManager.play(msg.target.ring ? `${msg.target.ring}环` : "未上靶");
|
||||
audioManager.play("距离合格");
|
||||
} else if (msg.constructor === MESSAGETYPES.InvalidShot) {
|
||||
distance.value = Number((msg.target.dst / 100).toFixed(2));
|
||||
audioManager.play("距离不足5米");
|
||||
audioManager.play("距离不足");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user