Пример #1
0
        public static void SetToggleText(this Toggle toggle, string text)
        {
            if (toggle.IsNull() == true)
            {
                return;
            }

            FindExtension.FindTextChild(toggle.transform).SetText(text);
        }
Пример #2
0
        public static void SetInteractable(this Button target, bool interactable, Color textColor, Color outlineColor)
        {
            if (target == null)
            {
                return;
            }

            target.interactable = interactable;

            Text buttonText = FindExtension.FindTextChild(target.transform);

            buttonText.SetColor(textColor);

            Outline buttonOutline = ComponentFactory.GetChildComponent <Outline>(target.gameObject, IfNotExist.ReturnNull);

            if (buttonOutline == null)
            {
                return;
            }

            buttonOutline.effectColor = outlineColor;
        }