Backbone - Localization
 
Loading...
Searching...
No Matches
Backbone::LocalizedAudio Class Reference

Automatically updates the AudioSource's clip with a localized AudioClip from the LocalizationManager. More...

Inheritance diagram for Backbone::LocalizedAudio:

Public Attributes

LocalizedAudioClip localizedAudioClip
 Localized audio clip data (puede usar una clave o valores inline).
 

Private Member Functions

void Awake ()
 
void OnEnable ()
 
void OnDisable ()
 
void UpdateAudio ()
 Updates the AudioSource's clip using the localized value from the manager.
 

Private Attributes

AudioSource audioSource
 

Detailed Description

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:

  1. Attach this component to a GameObject that has an AudioSource.
  2. Set the localizationKey in the Inspector to match a key defined in your localized audio clip data.
  3. 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.

Member Function Documentation

◆ Awake()

void Backbone::LocalizedAudio::Awake ( )
private

◆ OnDisable()

void Backbone::LocalizedAudio::OnDisable ( )
private

◆ OnEnable()

void Backbone::LocalizedAudio::OnEnable ( )
private

◆ UpdateAudio()

void Backbone::LocalizedAudio::UpdateAudio ( )
private

Updates the AudioSource's clip using the localized value from the manager.

Member Data Documentation

◆ audioSource

AudioSource Backbone::LocalizedAudio::audioSource
private

◆ localizedAudioClip

LocalizedAudioClip Backbone::LocalizedAudio::localizedAudioClip

Localized audio clip data (puede usar una clave o valores inline).


The documentation for this class was generated from the following file: