Seneral / Node_Editor_Framework

A flexible and modular Node Editor Framework for creating node based displays and editors in Unity
https://nodeeditor.seneral.dev
MIT License
2.01k stars 414 forks source link

Load node canvas from memory instead of disk #124

Closed richjoslin closed 7 years ago

richjoslin commented 7 years ago

I'd like to have multiple un-saved canvases open at once, and therefore I need a way to easily load one of those canvases into the editor on demand. Overloading NodeEditorUserCache.LoadNodeCanvas to accept a NodeCanvas pointer seems to be the way to go?

richjoslin commented 7 years ago

Didn't notice the SetCanvas method. I think this does just what I was wanting.

Seneral commented 7 years ago

Well the load function doesn't need to be called - it only handles loading from the disk into memory. When using the NodeEditorUserCache wrapper which manages the canvas you just use the SetCanvas method, true - this essentially does nothing other than assigning the canvas to mainNodeEditor so it's used from then on to draw for example.