From e8dd5d4fd406e6e6b710cbe85309f6870bccc37a Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 3 Nov 2019 18:31:04 -0500 Subject: Remove everything --- .../Lean/Localization/Scripts/LeanToken.cs | 130 --------------------- 1 file changed, 130 deletions(-) delete mode 100644 Assets/Packages/Lean/Localization/Scripts/LeanToken.cs (limited to 'Assets/Packages/Lean/Localization/Scripts/LeanToken.cs') diff --git a/Assets/Packages/Lean/Localization/Scripts/LeanToken.cs b/Assets/Packages/Lean/Localization/Scripts/LeanToken.cs deleted file mode 100644 index c6ca7f8..0000000 --- a/Assets/Packages/Lean/Localization/Scripts/LeanToken.cs +++ /dev/null @@ -1,130 +0,0 @@ -using UnityEngine; -using System.Collections.Generic; -using Lean.Common; -#if UNITY_EDITOR -using UnityEditor; - -namespace Lean.Localization -{ - [CustomEditor(typeof(LeanToken))] - public class LeanToken_Inspector : LeanInspector - { - protected override void DrawInspector() - { - Draw("value"); - } - } -} -#endif - -namespace Lean.Localization -{ - /// The class stores a token name (e.g. "AGE"), allowing it to be replaced with the token value (e.g. "20"). - /// To use the token in your text, simply include the token name surrounded by braces (e.g. "I am {AGE} years old!") - [ExecuteInEditMode] - [HelpURL(LeanLocalization.HelpUrlPrefix + "LeanToken")] - [AddComponentMenu(LeanLocalization.ComponentPathPrefix + "Token")] - public class LeanToken : LeanSource - { - [SerializeField] - private string value; - - [System.NonSerialized] - private HashSet behaviours; - - [System.NonSerialized] - private static HashSet tempBehaviours = new HashSet(); - - public string Value - { - set - { - if (this.value != value) - { - this.value = value; - - if (behaviours != null) - { - tempBehaviours.Clear(); - - tempBehaviours.UnionWith(behaviours); - - foreach (var behaviour in tempBehaviours) - { - behaviour.UpdateLocalization(); - } - } - } - } - - get - { - return value; - } - } - - public void SetValue(float value) - { - Value = value.ToString(); - } - - public void SetValue(string value) - { - Value = value; - } - - public void SetValue(int value) - { - Value = value.ToString(); - } - - public void Register(LeanLocalizedBehaviour behaviour) - { - if (behaviour != null) - { - if (behaviours == null) - { - behaviours = new HashSet(); - } - - behaviours.Add(behaviour); - } - } - - public void Unregister(LeanLocalizedBehaviour behaviour) - { - if (behaviours != null) - { - behaviours.Remove(behaviour); - } - } - - public void UnregisterAll() - { - if (behaviours != null) - { - foreach (var behaviour in behaviours) - { - behaviour.Unregister(this); - } - - behaviours.Clear(); - } - } - - public override void Compile(string primaryLanguage, string secondaryLanguage) - { - if (string.IsNullOrEmpty(name) == false) - { - LeanLocalization.CurrentTokens.Add(name, this); - } - } - - protected override void OnDisable() - { - base.OnDisable(); - - UnregisterAll(); - } - } -} \ No newline at end of file -- cgit v1.2.3