public void InitGraphViews(BaseGraphView graphViewPrefab, Transform parent, NodeTemplate nodeTemplate, EdgeTemplate edgeTemplate) { foreach (var chunk in _chunks) { chunk.InitGraphView(graphViewPrefab, parent, nodeTemplate, edgeTemplate); var center = _min + _chunkRange * 0.5f + new Vector3( _chunkRange.x * chunk.Index.x, _chunkRange.y * chunk.Index.y, _chunkRange.z * chunk.Index.z ); chunk.GraphView.SetBounds(center, _chunkRange); chunk.GraphView.name = "GraphView " + chunk.Index; } }
protected virtual void SetNodeTemplate(NodeTemplate nodeTemplate) { _nodeTemplate = nodeTemplate; }
public void InitGraphView(BaseGraphView graphViewPrefab, Transform parent, NodeTemplate nodeTemplate, EdgeTemplate edgeTemplate) { GraphView = Instantiate(graphViewPrefab, parent, false); GraphView.NodeTemplate = nodeTemplate; GraphView.EdgeTemplate = edgeTemplate; GraphView.MouseDown += GraphView_MouseDown; GraphView.MouseMove += GraphView_MouseMove; GraphView.MouseUp += GraphView_MouseUp; GraphView.SetGraph(NodePresenters, EdgePresenters); }
protected override void SetNodeTemplate(NodeTemplate nodeTemplate) { base.SetNodeTemplate(nodeTemplate); // TODO: set Material }