From e8dd5d4fd406e6e6b710cbe85309f6870bccc37a Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 3 Nov 2019 18:31:04 -0500 Subject: Remove everything --- .../Localization/Scripts/LeanLocalizedBehaviour.cs | 121 --------------------- 1 file changed, 121 deletions(-) delete mode 100644 Assets/Packages/Lean/Localization/Scripts/LeanLocalizedBehaviour.cs (limited to 'Assets/Packages/Lean/Localization/Scripts/LeanLocalizedBehaviour.cs') diff --git a/Assets/Packages/Lean/Localization/Scripts/LeanLocalizedBehaviour.cs b/Assets/Packages/Lean/Localization/Scripts/LeanLocalizedBehaviour.cs deleted file mode 100644 index 4163464..0000000 --- a/Assets/Packages/Lean/Localization/Scripts/LeanLocalizedBehaviour.cs +++ /dev/null @@ -1,121 +0,0 @@ -using UnityEngine; -using UnityEngine.Serialization; -using System.Collections.Generic; -using Lean.Common; -#if UNITY_EDITOR -using UnityEditor; - -namespace Lean.Localization -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(LeanLocalizedBehaviour), true)] - public class LeanLocalizedBehaviour_Inspector : LeanInspector - { - } -} -#endif - -namespace Lean.Localization -{ - /// This component simplifies the updating process, extend it if you want to cause a specific object to get localized - public abstract class LeanLocalizedBehaviour : MonoBehaviour - { - [Tooltip("The name of the phrase we want to use for this localized component")] - [SerializeField] - [LeanTranslationName] - [FormerlySerializedAs("phraseName")] - [FormerlySerializedAs("translationTitle")] - private string translationName; - - [System.NonSerialized] - private HashSet tokens; - - /// This is the name of the translation this script uses. - public string TranslationName - { - set - { - if (translationName != value) - { - translationName = value; - - UpdateLocalization(); - } - } - - get - { - return translationName; - } - } - - public void Register(LeanToken token) - { - if (token != null) - { - if (tokens == null) - { - tokens = new HashSet(); - } - - tokens.Add(token); - } - } - - public void Unregister(LeanToken token) - { - if (tokens != null) - { - tokens.Remove(token); - } - } - - public void UnregisterAll() - { - if (tokens != null) - { - foreach (var token in tokens) - { - token.Unregister(this); - } - - tokens.Clear(); - } - } - - // This gets called every time the translation needs updating - // NOTE: translation may be null if it can't be found - public abstract void UpdateTranslation(LeanTranslation translation); - - /// If you call this then this component will update using the translation for the specified phrase. - [ContextMenu("Update Localization")] - public void UpdateLocalization() - { - UpdateTranslation(LeanLocalization.GetTranslation(translationName)); - } - - protected virtual void OnEnable() - { - LeanLocalization.OnLocalizationChanged += UpdateLocalization; - - UpdateLocalization(); - } - - protected virtual void OnDisable() - { - LeanLocalization.OnLocalizationChanged -= UpdateLocalization; - - UnregisterAll(); - } - -#if UNITY_EDITOR - protected virtual void OnValidate() - { - if (isActiveAndEnabled == true) - { - UpdateLocalization(); - } - } -#endif - } -} \ No newline at end of file -- cgit v1.2.3