| Parameter | Description |
|---|---|
| orderedIds | The desired key-id order. |
Reorders the keys to match a given sequence of ids.
Keys are arranged in the order their ids appear in orderedIds. Ids that are not listed keep their
relative order and follow the listed keys. A null or empty list leaves the order unchanged.
Additional resources: SharedTableData.Entries
<para>Move a key to the front by listing its id first.</para>
using System.Collections.Generic; using Unity.Localization; using UnityEngine;
namespace Unity.Localization.Samples { public class SharedTableDataSetKeyOrderExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); long a = sharedData.AddKey("A").Id; long b = sharedData.AddKey("B").Id;
sharedData.SetKeyOrder(new List<long> { b, a }); // B now comes first
Debug.Log(sharedData.Entries[0].Key); // B } } }