コード例 #1
0
ファイル: MixesPanel.cs プロジェクト: nivhs/ThemeMixer
        private void OnTextFieldTextChanged(UIComponent component, string value)
        {
            var textfield = component as UITextField;

            if (textfield == null)
            {
                return;
            }
            if (textfield.text.Length > 0 && !int.TryParse(textfield.text[0].ToString(), out int _))
            {
                _saveButtonPanel.EnableButton(Translation.Instance.GetTranslation(TranslationID.BUTTON_SAVE));
                textfield.textColor = Color.black;
            }
            else
            {
                textfield.textColor = Color.red;
                _saveButtonPanel.DisableButton();
            }
        }