Represents an audio clip localized by language, either through direct assignment or via a global key. More...
Classes | |
class | LocalizedClip |
Represents a localized audio clip for a specific language. More... | |
Public Member Functions | |
if (!string.IsNullOrEmpty(key)) | |
if (match !=null &&match.clip !=null) return match.clip | |
foreach (var c in clips) | |
Static Public Member Functions | |
static implicit | operator AudioClip (LocalizedAudioClip localizedAudioClip) |
Implicitly converts the LocalizedAudioClip to an AudioClip for convenience. | |
Public Attributes | |
string | key |
Optional key used to fetch the audio clip from the LocalizationManager. | |
List< LocalizedClip > | clips = new List<LocalizedClip>() |
List of audio clips associated with specific languages. Used as fallback if no key is provided or found. | |
class Backbone::LocalizedAudioClip::LocalizedClip | language = LocalizationManager.instance?.currentLanguage |
Resolves and returns the localized AudioClip for the current language. First checks the key in the LocalizationManager. If not found, it looks in the local list. | |
var | match = clips.Find(c => c.language == language) |
return | null |
Represents an audio clip localized by language, either through direct assignment or via a global key.
This class supports two localization strategies:
key
that maps to a centralized audio clip in the LocalizationManager.clips
list for each language.The system will first try to resolve the key through the LocalizationManager. If no match is found or the key is empty, it will fallback to the internal list of localized audio clips.
Example usage:
Backbone::LocalizedAudioClip::foreach | ( | var c in | clips | ) |
Backbone::LocalizedAudioClip::if | ( | !string. | IsNullOrEmptykey | ) |
|
static |
Implicitly converts the LocalizedAudioClip to an AudioClip for convenience.
List<LocalizedClip> Backbone::LocalizedAudioClip::clips = new List<LocalizedClip>() |
List of audio clips associated with specific languages. Used as fallback if no key is provided or found.
string Backbone::LocalizedAudioClip::key |
Optional key used to fetch the audio clip from the LocalizationManager.
class Backbone::LocalizedAudioClip::LocalizedClip Backbone::LocalizedAudioClip::language = LocalizationManager.instance?.currentLanguage |
Resolves and returns the localized AudioClip for the current language. First checks the key in the LocalizationManager. If not found, it looks in the local list.
var Backbone::LocalizedAudioClip::match = clips.Find(c => c.language == language) |
return Backbone::LocalizedAudioClip::null |