RemoveEntry(long)
Removes the entry for a stable key id from this table.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
public void RemoveEntry(long keyId)
Parameters
The stable key id of the entry to remove.
Remarks
Removes only this locale's value. The key stays in ResourceTable.SharedData and the other locale tables keep their entries. Does nothing when no entry matches the id. To drop the key from the whole collection, call SharedTableData.RemoveKey as well.
Remove a single entry and confirm it is gone.
Examples
using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class ResourceTableRemoveEntryExample { public void Run() { var shared = ScriptableObject.CreateInstance<SharedTableData>(); var table = ScriptableObject.CreateInstance<ResourceTable>(); table.SharedData = shared; table.LocaleIdentifier = "en"; var entry = table.AddStringEntry("Greeting", "Hello"); table.RemoveEntry(entry.KeyId); Debug.Log(table.GetEntry(entry.KeyId) == null); // True } }}