A localized string list that combines several localized string references.
Each item is its own LocalizedString, so the items can come from different entries or collections.
LocalizedStringGroup.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.
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); } } }
| Property | Description |
|---|---|
| Strings | The localized strings that make up the list, in list order. |