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

ResourceTable.RemoveEntry

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

Declaration

public void RemoveEntry(long keyId);

Parameters

Parameter Description
keyId The stable key id of the entry to remove.

Description

Removes the entry for a stable key id from this table.

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.

Additional resources: ResourceTable.RemoveAllEntries, ResourceTable.AddEntry, SharedTableData

<para>Remove a single entry and confirm it is gone.</para>

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