Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Clear()

Removes every key from the shared data.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
public void Clear()

Remarks

This clears the shared key table only. The entries in each per-locale ResourceTable are left untouched, so clear the shared data and every locale table together to avoid orphaning translations.
Remove all keys from the shared data.

Examples

using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class SharedTableDataClearExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); sharedData.AddKey("GREETING"); sharedData.AddKey("FAREWELL"); sharedData.Clear(); Debug.Log(sharedData.Entries.Count); // 0 } }}