private void ProcessValueChange(CheckboxType checkboxType, bool newValue)
        {
            if (newValue /*== true*/ && !_skipNextCheck)
            {
                DisableCheckboxesExcept(checkboxType);
                var result = default(string);

                switch (checkboxType)
                {
                case CheckboxType.Male:
                    result = UserProfileGender.MALE;
                    break;

                case CheckboxType.Female:
                    result = UserProfileGender.FEMALE;
                    break;

                case CheckboxType.Other:
                    result = UserProfileGender.OTHER;
                    break;

                case CheckboxType.PreferNot:
                    result = UserProfileGender.PREFER_NOT;
                    break;

                default:
                    Debug.LogError($"Unexpected checkboxType: {checkboxType.ToString()}");
                    break;
                }

                base.RaiseEntryEdited(result);
            }
        }
Пример #2
0
 // Use this for initialization
 public void InitCheckbox(int id, int condition, string text, CheckboxType type, int vocation)
 {
     m_curID          = id;
     triggerCondition = condition;
     UILabel.text     = text;
     m_type           = type;
     m_vocation       = vocation;
 }
        private void DisableCheckboxesExcept(CheckboxType activeCheckbox)
        {
            var activeCheckboxIndex = (int)activeCheckbox;

            for (int i = 0; i < _checkboxes.Length; i++)
            {
                if (i != activeCheckboxIndex && _checkboxes[i].isOn)
                {
                    _checkboxes[i].isOn = false;
                }
            }
        }
Пример #4
0
 public static string ToClass(this CheckboxType type)
 {
     return(type.ToString().ToLower());
 }