Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

LocalizedStringGroup

class in Unity.Localization


Implements interfaces:ILocalizedStringList

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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); } } }

Properties

Property Description
Strings The localized strings that make up the list, in list order.