/// <summary> /// Adds the key/value pair if the key does not already exist. /// </summary> /// <param name="key"></param> /// <param name="value"></param> public void AddKVP(string key, string value) { if (HasKVP(key)) { Debug.LogWarningFormat(WearableConstants.LOCALE_KEY_ALREADY_EXISTS_FORMAT, key); return; } // If we're in the editor and not playing, add this to our serialized cache // Otherwise add it to our runtime collection. #if UNITY_EDITOR if (!Application.isPlaying) { LocaleKVPs.Add(new LocaleKVP() { key = key, value = value }); return; } #endif LocaleLookup.Add(key, value); }
/// <summary> /// Clears the serialized cache of locale data. /// </summary> public void Clear() { LocaleKVPs.Clear(); }