Localization
public class Localization : ScriptableObjectInherits from ScriptableObject
#Nested Types
- LocalizationTableEntry class
#Properties
#UsesAddressableAssets
true), or if it
stores its assets as direct references (false).public bool UsesAddressableAssets { get; internal set; }Type Boolean
true, GetLocalizedObjectAsync<T>(string) and ContainsLocalizedObject<T>(string) should not be used to retrieve
localised objects. Instead, the Addressable Assets API should be
used.#Methods
#AddLocalizedString(string, string)
public void AddLocalizedString(string key, string value)Parameters
keystringThe key for this string (generally, the line ID.)valuestringThe user-facing text for this string, in the language specified byLocaleCode.
#AddLocalizedStrings(IEnumerable<KeyValuePair<string, string>>)
public void AddLocalizedStrings(IEnumerable<KeyValuePair<string, string>> strings)Parameters
stringsIEnumerable<KeyValuePair<string, string>>The collection of keys and strings to add.
#AddLocalizedStrings(IEnumerable<StringTableEntry>)
public void AddLocalizedStrings(IEnumerable<StringTableEntry> stringTableEntries)Parameters
strings(unknown)The collection of StringTableEntry objects to add.stringTableEntriesIEnumerable<Yarn.Unity.StringTableEntry>
#Clear()
public virtual void Clear()#ContainsLocalizedObject<T>(string)
public bool ContainsLocalizedObject<T>(string key)
where T : UnityEngine.Object;Type Parameters
TThe expected asset type
Parameters
keystringthe id of the localised line
Returns Boolean: true if there is an asset of the requested type under the requested key, false otherwise.
#ContainsLocalizedString(string)
public bool ContainsLocalizedString(string key);Parameters
keystringThe key to search for.
Returns Boolean: true if this Localization has a string
for the given key; false otherwise.
#GetLineIDs()
public IEnumerable<string> GetLineIDs()Returns IEnumerable: The line IDs.
#GetLocalizedObjectAsync<T>(string)
public async YarnTask<T?> GetLocalizedObjectAsync<T>(string key)
where T : UnityEngine.ObjectType Parameters
TThe expected type of the asset
Parameters
keystringthe line id of the localised entry whos asset you're after
Returns YarnTask: The localised asset, or null if there wasn't one found
#GetLocalizedString(string)
public string? GetLocalizedString(string key)Parameters
keystring
Returns String
Generated from Yarn Spinner for Unity 3.3.