public virtual void ActivateState(string name)
        {
            if (name == ActiveStateName)
            {
                return;
            }

            // Apply state changes based on component state names
            if (!ignoreComponentStateNames)
            {
                // Deactivate the previous active states
                setStates(ActiveStateName, false);

                // Activate the new ones
                setStates(name, true);
            }

            // Then perform any state overrides if desired
            if (!ignoreStateOverrides)
            {
                StateOverride so = findState(name);
                if (so != null)
                {
                    deactivateState(ActiveStateName);
                    so.SetActive(true);
                }
            }

            ActiveStateName = name;
        }
 void deactivateState(string name)
 {
     if (name != null && name.Length > 0)
     {
         StateOverride so = findState(name);
         if (so != null)
         {
             so.SetActive(false);
         }
     }
 }