LocalizedStringGroup
A localized string list that combines several localized string references.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Class
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
- Implements: ILocalizedStringList
public class LocalizedStringGroup : ILocalizedStringList
Remarks
Each item is its own LocalizedString, so the items can come from different entries or collections. ListChanged is raised once every item has resolved, and again when any item's value changes. The subscription does not observe edits to LocalizedStringGroup.Strings; unsubscribe and resubscribe after changing the list.
Additional Resources: ILocalizedStringList, LocalizedStringList
Aggregate several entries into one list.
Examples
using System.Collections.Generic;using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class LocalizedStringGroupExample { public async Awaitable Load() { var yes = new LocalizedString(); yes.SetReference("My Strings", "YES"); var no = new LocalizedString(); no.SetReference("My Strings", "NO"); var group = new LocalizedStringGroup(); group.Strings.Add(yes); group.Strings.Add(no); List<string> values = await group.GetLocalizedListAsync(); Debug.Log(values.Count); } }}
Properties
Property | Description |
|---|---|
| Strings | The localized strings that make up the list, in list order. |