Esempio n. 1
0
        private void UpdateList()
        {
            mNodeFoldout      = new FoldoutFolder("所有节点", SelectNodeFolderCallback);
            mNodeFoldout.Fold = true;

            BTNodeInfoComponent btNodeInfoComponent = BTEditor.Instance.GetComponent <BTNodeInfoComponent>();

            foreach (string classify in btNodeInfoComponent.GetAllClassify())
            {
                List <NodeMeta> nodeTypeList = btNodeInfoComponent.GetNodeMetas(classify);
                FoldoutFolder   folder       = mNodeFoldout.AddFolder(classify, SelectNodeFolderCallback);
                folder.Fold = true;

                mNodeCount++;
                foreach (NodeMeta nodeType in nodeTypeList)
                {
                    folder.AddNode(classify, nodeType.name + " (" + nodeType.describe + ")", SelectNodeCallback);
                    mNodeCount++;
                }
            }
        }
Esempio n. 2
0
        public List <string> GetCanCreateList()
        {
            List <string> result = new List <string>();

            BTNodeInfoComponent btNodeInfoComponent = BTEditor.Instance.GetComponent <BTNodeInfoComponent>();

            foreach (string classify in btNodeInfoComponent.GetAllClassify())
            {
                List <NodeMeta> nodeProtoList = btNodeInfoComponent.GetNodeMetas(classify);
                nodeProtoList.Sort(CompareShowName);
                if (classify == NodeClassifyType.Root.ToString())
                {
                    continue;
                }
                foreach (NodeMeta node in nodeProtoList)
                {
                    if (mSelectedNode != null && mSelectedNode.NodeData.Children.Count < mSelectedNode.NodeData.Proto.child_limit)
                    {
                        result.Add(node.name);
                    }
                }
            }
            return(result);
        }