void DrawArrayEntry(PListDictionary dic)
    {
        var array = dic.ArrayValue(VALUE_KEY);

        if (array != null)
        {
            EditorGUILayout.Popup(0, array.ToStringArray(), GUILayout.MaxWidth(600));
        }

        string val = "";

        if (dic.BoolValue(INHERIT_KEY))
        {
            val += "Inherit";
        }

        if (dic.BoolValue(PATH_KEY))
        {
            if (!string.IsNullOrEmpty(val))
            {
                val += " : ";
            }

            val += "Path";
        }

        EditorGUILayout.LabelField(val, GUILayout.MaxWidth(600));
    }
    void PopulateEdit(PListDictionary dic)
    {
        ResetEntry();
        _name               = dic.StringValue(DISPLAY_NAME_KEY);
        _setting            = dic.StringValue(SETTING_KEY);
        _isValidSettingName = ValidateSettingString(_setting);
        _groupIndex         = System.Array.IndexOf(_groups, dic.StringValue(GROUP_KEY));

        if (_groupIndex < 0)
        {
            _groupIndex = 0;
        }

        _entryType = (SettingType)System.Enum.Parse(typeof(SettingType), dic.StringValue(TYPE_KEY));

        switch (_entryType)
        {
        case SettingType.Bool:
            _boolDefaultValue = dic.BoolValue(VALUE_KEY);
            break;

        case SettingType.Enum:
            var valDic = dic.DictionaryValue(VALUE_KEY);

            if (valDic != null)
            {
                foreach (var key in valDic.Keys)
                {
                    _enumValues[key] = valDic.StringValue(key);
                }
            }

            var defaultIndex = dic.IntValue(DEFAULT_INDEX);
            _defaultEnum = _enumValues.Keys.ToList()[defaultIndex];
            break;

        case SettingType.String:
            _stringDefaultValue = dic.StringValue(VALUE_KEY);
            _isPath             = dic.BoolValue(PATH_KEY);
            break;

        case SettingType.Array:
        case SettingType.StringList:
            _isInherit = dic.BoolValue(INHERIT_KEY);
            _isPath    = dic.BoolValue(PATH_KEY);
            break;

        default:
            break;
        }
    }
示例#3
0
        public FrameworkEntry(PListDictionary dic)
            : base(dic)
        {
            var lm = dic.StringValue(LINK_TYPE_KEY);

            Link     = (LinkType)System.Enum.Parse(typeof(LinkType), lm);
            Embedded = dic.BoolValue(EMBEDDED_KEY);
        }
    void DrawStringEntry(PListDictionary dic)
    {
        string val = dic.StringValue(VALUE_KEY);

        if (dic.BoolValue(PATH_KEY))
        {
            if (!string.IsNullOrEmpty(val))
            {
                val += " : ";
            }

            val += "Path";
        }

        EditorGUILayout.LabelField(val, GUILayout.MaxWidth(600));
    }
 void DrawBoolEntry(PListDictionary dic)
 {
     EditorGUILayout.LabelField(dic.BoolValue(VALUE_KEY) ? "Yes" : "No", GUILayout.MaxWidth(600));
 }