feat: 收敛玩法运行时配置并加入故障恢复

This commit is contained in:
2026-04-01 13:04:26 +08:00
parent 1635a11780
commit 3ef841ecc7
73 changed files with 8820 additions and 2122 deletions

View File

@@ -66,6 +66,11 @@ export class SoundDirector {
}
const hasFinishCompletion = effects.some((effect) => effect.type === 'control_completed' && effect.controlKind === 'finish')
if (hasFinishCompletion) {
this.stopGuidanceLoop()
this.play('control_completed:finish')
return
}
for (const effect of effects) {
if (effect.type === 'session_started') {
@@ -85,15 +90,19 @@ export class SoundDirector {
}
if (effect.type === 'guidance_state_changed') {
if (effect.guidanceState === 'searching') {
this.startGuidanceLoop('guidance:searching')
if (effect.guidanceState === 'distant') {
this.startGuidanceLoop('guidance:distant')
continue
}
if (effect.guidanceState === 'approaching') {
this.startGuidanceLoop('guidance:approaching')
continue
}
this.startGuidanceLoop('guidance:ready')
if (effect.guidanceState === 'ready') {
this.startGuidanceLoop('guidance:ready')
continue
}
this.stopGuidanceLoop()
continue
}
@@ -273,6 +282,7 @@ export class SoundDirector {
isGuidanceCue(key: AudioCueKey): boolean {
return key === 'guidance:searching'
|| key === 'guidance:distant'
|| key === 'guidance:approaching'
|| key === 'guidance:ready'
}