예제 #1
0
    public void ResetLayoutTree()
    {
        layoutTree                     = new EditorTreeView();
        layoutTree.OnDrag             += onFileTreeDrag;
        layoutTree.OnNodeToggleChange += onLayoutNodeToggleChange;
        layoutTree.CanRenameNode       = false;

        for (int i = 0; i < m_layout_mng.LayoutCount; i++)
        {
            TreeNode node = TreeNodeFactory.CreateNewLayoutTreeNode(m_layout_mng.GetLayoutName(i), m_layout_mng.IsLayoutVisible(i), m_layout_mng.CurEditLayoutIndex == i);
            node.DataKey = i;

            layoutTree.AddRootNode(node);
        }
    }
예제 #2
0
    private void buildUITree(UIElement element)
    {
        uiTree = new EditorTreeView();
        //uiTree.OnDrag += onDragNode;
        //uiTree.OnDrop += onDropNode;
        uiTree.OnNodeToggleChange += onUINodeToggleChange;
        uiTree.OnNodeNameChange   += onUINodeNameChange;
        uiTree.OnNodeSelChange    += onUINodeSelChange;
        uiTree.AddMenuItem("添加节点", AddNode);
        uiTree.AddMenuItem("删除节点", RemoveNode);

        TreeNode node = TreeNodeFactory.CreateNewUITreeNode(element.Name, element.Hide, element.Freeze, element.Lock);

        node.DataKey       = element;
        node.CanRenameByUI = !LayoutTool.HasUI(element.gameObject, false);
        uiTree.AddRootNode(node);

        buildUITreeRev(element, node);
    }