示例#1
0
    void ShowPropertyBinderEditor(int index)
    {
        var prop   = _binders.GetArrayElementAtIndex(index);
        var finder = new RelativePropertyFinder(prop);

        // Header
        CoreEditorUtils.DrawSplitter();

        var toggle = CoreEditorUtils.DrawHeaderToggle
                         (PropertyBinderNameUtil.Shorten(prop),
                         prop, finder["Enabled"],
                         pos => CreateHeaderContextMenu(index)
                         .DropDown(new Rect(pos, Vector2.zero)));

        if (!toggle)
        {
            return;
        }

        _binders.serializedObject.Update();
        EditorGUILayout.Space();

        // Properties
        var target = finder["Target"];

        EditorGUILayout.PropertyField(target);

        if (ComponentSelector.GetInstance(target).ShowGUI(target) &&
            PropertySelector.GetInstance(target, finder["_propertyType"])
            .ShowGUI(finder["PropertyName"]))
        {
            // EditorGUILayout.PropertyField(finder["Value0"], Styles.Value0);
            // EditorGUILayout.PropertyField(finder["Value1"], Styles.Value1);
        }

        _binders.serializedObject.ApplyModifiedProperties();
        EditorGUILayout.Space();
    }