예제 #1
0
    internal override bool DrawEntry(Egomotion.EgoXproject.Internal.PListDictionary dic)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField(dic.StringValue(SETTING_KEY));
        EditorGUILayout.LabelField(dic.StringValue(NAME_KEY));
        var type = dic.StringValue(TYPE_KEY);

        if (type == BOOL_TYPE_VALUE)
        {
            var value = dic.BoolValue(VALUE_KEY);
            EditorGUILayout.LabelField(value ? "Yes" : "No");
        }
        else if (type == STRING_TYPE_VALUE)
        {
            var value = dic.StringValue(VALUE_KEY);
            EditorGUILayout.LabelField(value);
        }
        else if (type == INTEGER_TYPE_VALUE)
        {
            var value = dic.IntValue(VALUE_KEY);
            EditorGUILayout.LabelField(value.ToString());
        }
        else if (type == REAL_TYPE_VALUE)
        {
            var value = dic.FloatValue(VALUE_KEY);
            EditorGUILayout.LabelField(value.ToString());
        }
        else if (type == ARRAY_TYPE_VALUE)
        {
            //TODO should also be able to draw a defaul array entries
            EditorGUILayout.LabelField("Array");
        }
        else if (type == DICTIONARY_TYPE_VALUE)
        {
            //TODO should also be able to draw a defaul array entries
            EditorGUILayout.LabelField("Dictionary");
        }
        else
        {
            EditorGUILayout.LabelField("UNKNOWN");
        }

        bool remove = false;;

        if (GUILayout.Button("-"))
        {
            remove = true;
        }

        EditorGUILayout.EndHorizontal();

        return(remove);
    }