Represents a texture localized by language, either through a global key or direct per-language assignment. More...
Classes | |
| class | LocalizedTextureValue |
| Structure representing a texture for a specific language. More... | |
Public Member Functions | |
| if (!string.IsNullOrEmpty(key)) | |
| if (match !=null &&match.texture !=null) return match.texture | |
| foreach (var t in textures) | |
Static Public Member Functions | |
| static implicit | operator Texture (LocalizedTexture localizedTexture) |
| Implicit conversion from LocalizedTexture to Texture. Allows using LocalizedTexture where a Texture is expected. | |
Public Attributes | |
| string | key |
Key used to retrieve a localized texture from the LocalizationManager. If empty or not found, the system falls back to local textures list. | |
| List< LocalizedTextureValue > | textures = new List<LocalizedTextureValue>() |
| List of localized texture entries for each language. Used when no key is provided or key lookup fails. | |
| class Backbone::LocalizedTexture::LocalizedTextureValue | language = LocalizationManager.instance?.currentLanguage |
| Returns the texture corresponding to the current language. Priority: Lookup by key in manager -> fallback to local list -> fallback to first texture or null. | |
| var | match = textures.Find(t => t.language == language) |
| return | null |
Represents a texture localized by language, either through a global key or direct per-language assignment.
This class supports two localization strategies:
key that maps to a centralized texture in the LocalizationManager.The system prioritizes the key lookup. If no match is found or key is empty, it falls back to the local list.
Example usage:
| Backbone::LocalizedTexture::foreach | ( | var t in | textures | ) |
| Backbone::LocalizedTexture::if | ( | !string. | IsNullOrEmptykey | ) |
|
static |
Implicit conversion from LocalizedTexture to Texture. Allows using LocalizedTexture where a Texture is expected.
| string Backbone::LocalizedTexture::key |
Key used to retrieve a localized texture from the LocalizationManager. If empty or not found, the system falls back to local textures list.
| class Backbone::LocalizedTexture::LocalizedTextureValue Backbone::LocalizedTexture::language = LocalizationManager.instance?.currentLanguage |
Returns the texture corresponding to the current language. Priority: Lookup by key in manager -> fallback to local list -> fallback to first texture or null.
| var Backbone::LocalizedTexture::match = textures.Find(t => t.language == language) |
| return Backbone::LocalizedTexture::null |
| List<LocalizedTextureValue> Backbone::LocalizedTexture::textures = new List<LocalizedTextureValue>() |
List of localized texture entries for each language. Used when no key is provided or key lookup fails.