public void SetTree( BehaviourTree xTree ) { m_tree = xTree; this.RemoveAllSubviews(); Node xRootNode = m_tree.RootNode; m_rootNodeView = this.CreateNodeViews( xRootNode ); }
private void DrawNodeViews( NodeView xNodeView ) { List<Vector2> xEndPoints = new List<Vector2>(); NodeView[] xChildNodeViews = xNodeView.ChildNodeViews; for ( int iChildViewIndex = 0; iChildViewIndex < xChildNodeViews.Length; iChildViewIndex++ ) { NodeView xChildNodeView = xChildNodeViews[ iChildViewIndex ]; Vector2 xEndPoint = xChildNodeView.Centre; xEndPoint.y += 0.5f * NodeGridSpacingY; xEndPoints.Add( xEndPoint ); } float fStartPointX = xNodeView.Centre.x; float fStartPointY = xNodeView.Centre.y + 0.5f * NodeGridSpacingY; xNodeView.Draw(); foreach ( Vector2 xEndPoint in xEndPoints ) { float fEndPointX = xEndPoint.x; float fEndPointY = xEndPoint.y; GL.Begin( GL.LINES ); GL.Vertex3( fStartPointX, fStartPointY, 0 ); GL.Vertex3( fEndPointX, fEndPointY, 0 ); GL.End(); } }