public GUINodeInspectorView()
        {
            var designs = GUINodeEditors.editorTypes.FindAll((t) => { return(t.IsDefined(typeof(CustomGUINodeAttribute), false)); });
            var eles    = GUINodes.nodeTypes;

            foreach (var type in eles)
            {
                var typeTree = type.GetTypeTree();
                for (int i = 0; i < typeTree.Count; i++)
                {
                    Type des = designs.Find((t) => {
                        return((t.GetCustomAttributes(typeof(CustomGUINodeAttribute), false).First() as CustomGUINodeAttribute).EditType == typeTree[i]);
                    });
                    if (des != null)
                    {
                        dic.Add(type, Activator.CreateInstance(des) as GUINodeEditor);
                        break;
                    }
                }
            }

            GUINodeSelection.onNodeChange += (ele) =>
            {
                if (ele != null)
                {
                    Pan         = dic[ele.GetType()];
                    Pan.element = ele;
                }
            };
        }
Exemplo n.º 2
0
        private void EleGUI(GUINode ele)
        {
            GUINodeEditor des = dic[ele.GetType()];

            des.element = ele;
            des.OnSceneGUI(() => {
                for (int i = 0; i < ele.Children.Count; i++)
                {
                    EleGUI(ele.Children[i] as GUINode);
                }
            });
        }