See Accessing graph data - A* Pathfinding Project and Creating graphs during runtime - A* Pathfinding Project