コード例 #1
0
        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;
 }
コード例 #3
0
        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
ファイル: CheckboxType.cs プロジェクト: proxoft/SemanticUI
 public static string ToClass(this CheckboxType type)
 {
     return(type.ToString().ToLower());
 }