/// <summary>When rebuilding translations this method is called from any <b>LeanSource</b> components that define a token.</summary>
 public static void RegisterToken(string name, LeanToken token)
 {
     if (string.IsNullOrEmpty(name) == false && token != null && CurrentTokens.ContainsKey(name) == false)
     {
         CurrentTokens.Add(name, token);
     }
 }
 public void Unregister(LeanToken token)
 {
     if (tokens != null)
     {
         tokens.Remove(token);
     }
 }
        public void Register(LeanToken token)
        {
            if (token != null)
            {
                if (tokens == null)
                {
                    tokens = new HashSet <LeanToken>();
                }

                tokens.Add(token);
            }
        }
        public static bool TryGetLocalToken(GameObject root, string name, ref LeanToken result)
        {
            if (root != null)
            {
                root.GetComponentsInChildren(tempLocalTokens);

                foreach (var localToken in tempLocalTokens)
                {
                    if (localToken.name == name)
                    {
                        result = localToken;

                        return(true);
                    }
                }
            }

            return(false);
        }