Class LocalizedTextAsset

Namespace
SurvivorsMaker.Presentation
Assembly
SurvivorsMaker.Presentation.dll

A ready-made ITextProvider: translation tables per language. The authored text counts as AuthoredLanguage; keys a language does not list fall back to it. Assign to TextSource or Text.

[CreateAssetMenu(menuName = "Survivor Roguelite Maker/Localized Text", fileName = "LocalizedText", order = 22)]
public sealed class LocalizedTextAsset : ScriptableObject, ITextProvider
Inheritance
Object
ScriptableObject
LocalizedTextAsset
Implements
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Constructors

LocalizedTextAsset()

public LocalizedTextAsset()

Fields

AuthoredLanguage

[Tooltip("Code of the language the UI string table and the content assets are written in. Empty = not offered.")]
public string AuthoredLanguage

Field Value

string

DefaultLanguage

[Tooltip("Offered first when the player has not chosen. Empty = the authored language.")]
public string DefaultLanguage

Field Value

string

Translations

public List<LocalizedLanguage> Translations

Field Value

List<LocalizedLanguage>

Methods

Get(string, string)

The translation of key, or null (authored text).

public string Get(string key, string language)

Parameters

key string
language string

Returns

string

Invalidate()

Call after editing Translations from code.

public void Invalidate()

Set(string, string, string)

Adds or replaces one translation from code (the lookup is rebuilt; no Invalidate() call needed).

public void Set(string language, string key, string value)

Parameters

language string
key string
value string