I am working with SpriteKit and draw a scene by the help of the scene editor in xcode. According to SpriteKit, we can use Navigation graph to draw the paths and I am able to draw a path using navigation graph but i am not able to access this object in swift back-end.
How to access this Navigation graph object from the scene.
In the default SpriteKit template the
GameViewController
has a section in theviewDidLoad
function that copies over the Scene Editors Entities and Graphs.These Entities and Graphs array variables are declared in the GameScene. Then retrieve the graph from the array.
If there is more than one graph in the SpriteKit Editor, then use a query to retrieve it by name.