private NodeParam CreateNodeParam(Type nodeType, int nodeID) { NodeParam param = NodeInfoManager.GetNodeParam(nodeType, nodeID, _treeID, _isClient); _id2Node.Add(nodeID, param); return(param); }
private NodeParam CreateEmptyNode(int nodeID) { NodeParam param = NodeInfoManager.GetErrorParam(nodeID, _treeID); _id2Node.Add(nodeID, param); return(param); }
public bool Replace(int srcNodeID, Type rpType) { NodeParam param = _id2Node[srcNodeID]; NodeParam rpParam = NodeInfoManager.GetNodeParam(rpType, 0, 0, _isClient); param.Replace(rpParam); return(true); }
public void Awake() { _nodes = NodeInfoManager.GetAllParam(true); _nodes.AddRange(NodeInfoManager.GetAllParam(false)); }
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); }