Automatically updates the AudioSource's clip with a localized AudioClip from the LocalizationManager.
More...
Automatically updates the AudioSource's clip with a localized AudioClip from the LocalizationManager.
This component allows your game's audio to change dynamically based on the selected language. It listens for language changes and updates the AudioSource's clip
accordingly.
Usage:
- Attach this component to a GameObject that has an
AudioSource
.
- Set the
localizationKey
in the Inspector to match a key defined in your localized audio clip data.
- At runtime, the clip will be updated automatically when the language changes.
Example:
- Suppose your localization data contains: Key: voices.intro English: intro_en.mp3 Spanish: intro_es.mp3
- In the Inspector: localizationKey = "voices.intro"
- When the language is set to "Spanish", the AudioSource will play
intro_es.mp3
.
Notes:
- This component requires an
AudioSource
component.
- If the key is missing or not found, a warning is logged.
- The clip is replaced, but playback must be manually triggered if needed.