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

SharedTableData.RemoveKey

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 RemoveKey(string key);

Parameters

Parameter Description
key The key to remove.

Description

Removes a key from the shared data.

This removes the key from the shared key table only. The per-locale ResourceTable entries for the key are left untouched, so remove the key from the shared data and every locale table together to avoid orphaning translations. Does nothing when the key is absent.

Additional resources: SharedTableData.AddKey, SharedTableData.Clear

<para>Remove a single key from the shared data.</para>

using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples { public class SharedTableDataRemoveKeyExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); sharedData.AddKey("GREETING");

sharedData.RemoveKey("GREETING");

Debug.Log(sharedData.GetEntry("GREETING") == null); // True } } }