public void Awake()
 {
     _nodes = NodeInfoManager.GetAllParam(true);
     _nodes.AddRange(NodeInfoManager.GetAllParam(false));
 }
Esempio n. 2
0
        private void CanvasRightClick(BeTreeNode e, bool isAdd)
        {
            RunTimeNodeData  data         = _datas[e.SrcTreeID];
            List <NodeParam> allParam     = NodeInfoManager.GetAllParam(data.IsClient);
            NodeParam        srcNodeParam = data[e.NodeID];
            NodeClassifyType classfiy     = srcNodeParam.NodeClassType;
            List <NodeParam> ps           = new List <NodeParam>();

            foreach (NodeParam param in allParam)
            {
                switch (classfiy)
                {
                case NodeClassifyType.Action:
                case NodeClassifyType.Condition:
                case NodeClassifyType.DataTransform:
                case NodeClassifyType.Error:
                    if (!isAdd)
                    {
                        if (param.NodeClassType != NodeClassifyType.Root)
                        {
                            ps.Add(param);
                        }
                    }
                    break;

                case NodeClassifyType.Composite:
                case NodeClassifyType.Decorator:
                    if (!isAdd)
                    {
                        if (param.NodeClassType == NodeClassifyType.Decorator || param.NodeClassType == NodeClassifyType.Composite)
                        {
                            ps.Add(param);
                        }
                    }
                    else
                    {
                        if (param.NodeClassType != NodeClassifyType.Root)
                        {
                            ps.Add(param);
                        }
                    }
                    break;

                case NodeClassifyType.Root:
                    if (isAdd)
                    {
                        if (param.NodeClassType != NodeClassifyType.Root)
                        {
                            ps.Add(param);
                        }
                    }
                    else
                    {
                        if (param.NodeClassType == NodeClassifyType.Root)
                        {
                            ps.Add(param);
                        }
                    }
                    break;
                }
            }

            _curOpenningCtrl.Canvas.ShowAddNodePanel(e, ps.ToArray(), isAdd);
        }