feat: 收敛玩法运行时配置并加入故障恢复
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { DEFAULT_GAME_AUDIO_CONFIG, type GameAudioConfig } from '../audio/audioConfig'
|
||||
import { DEFAULT_GAME_AUDIO_CONFIG, type AudioCueKey, type GameAudioConfig } from '../audio/audioConfig'
|
||||
import { SoundDirector } from '../audio/soundDirector'
|
||||
import { type GameEffect } from '../core/gameResult'
|
||||
import { type AnimationLevel } from '../../utils/animationLevel'
|
||||
import {
|
||||
DEFAULT_GAME_HAPTICS_CONFIG,
|
||||
DEFAULT_GAME_UI_EFFECTS_CONFIG,
|
||||
type FeedbackCueKey,
|
||||
type GameHapticsConfig,
|
||||
type GameUiEffectsConfig,
|
||||
} from './feedbackConfig'
|
||||
@@ -61,12 +62,20 @@ export class FeedbackDirector {
|
||||
this.soundDirector.setAppAudioMode(mode)
|
||||
}
|
||||
|
||||
playAudioCue(key: AudioCueKey): void {
|
||||
this.soundDirector.play(key)
|
||||
}
|
||||
|
||||
playHapticCue(key: FeedbackCueKey): void {
|
||||
this.hapticsDirector.trigger(key)
|
||||
}
|
||||
|
||||
handleEffects(effects: GameEffect[]): void {
|
||||
this.soundDirector.handleEffects(effects)
|
||||
this.hapticsDirector.handleEffects(effects)
|
||||
this.uiEffectDirector.handleEffects(effects)
|
||||
|
||||
if (effects.some((effect) => effect.type === 'session_finished')) {
|
||||
if (effects.some((effect) => effect.type === 'session_finished' || effect.type === 'session_timed_out')) {
|
||||
this.host.stopLocationTracking()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user