Ejemplo n.º 1
0
        void OnEnable()
        {
            if (browserState == null)
            {
                browserState = new BrowserState();
            }

            browser     = new NodeBrowser(browserState);
            searchField = new SearchField();
            searchField.downOrUpArrowKeyPressed += browser.SetFocusAndEnsureSelectedItem;
            wantsMouseEnterLeaveWindow           = true;
        }
Ejemplo n.º 2
0
        protected void DrawOverrideMembers(string label = "Override Members")
        {
            Type type = graphInheritFrom.Get <Type>();

            if (type == null)
            {
                return;
            }
            VariableEditorUtility.DrawCustomList(
                graphOverrideMembers,
                label,
                drawElement: (position, index, element) => {
                EditorGUI.LabelField(position, NodeBrowser.GetRichMemberName(element));
            },
                addAction: (pos) => {
                var members      = EditorReflectionUtility.GetOverrideMembers(type);
                GenericMenu menu = new GenericMenu();
                for (int i = 0; i < members.Count; i++)
                {
                    var member = members[i];
                    if (member is PropertyInfo)
                    {
                        menu.AddItem(new GUIContent("Properties/" + NodeBrowser.GetRichMemberName(member)), graphOverrideMembers.Contains(member), () => {
                            graphOverrideMembers.Add(member);
                        });
                    }
                    else
                    {
                        menu.AddItem(new GUIContent("Methods/" + NodeBrowser.GetRichMemberName(member)), graphOverrideMembers.Contains(member), () => {
                            graphOverrideMembers.Add(member);
                        });
                    }
                }
                menu.ShowAsContext();
            },
                removeAction: (index) => {
                graphOverrideMembers.RemoveAt(index);
            }
                );
        }
Ejemplo n.º 3
0
 public MemberTreeView(MemberInfo member, int id, int depth) : base(id, depth, NodeBrowser.GetRichMemberName(member))
 {
     this.member = member;
 }
Ejemplo n.º 4
0
 public MemberTreeView(MemberInfo member) : base(member.GetHashCode(), -1, NodeBrowser.GetRichMemberName(member))
 {
     this.member = member;
 }