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

Windows path problems "\\" #136

Closed kpietraszko closed 6 years ago

kpietraszko commented 7 years ago

ResourceManager.PreparePath() has this piece of code: if (!path.StartsWith ("Assets/")) path = _ResourcePath + path; But I've noticed PreparePath() is sometimes called with path "Assets\\Plugins\\Editor\\Node_Editor/LastSession.asset" Then it doesn't enter the if and returned path is wrong - this produces error: UnityException: Cannot load NodeCanvas: The file at the specified path 'Assets/Plugins/Node_Editor/Resources/Assets\Plugins\Editor\Node_Editor/LastSession.asset' is no valid save file Not in all projects, but it does happen (on Windows). Doing path = path.Replace("\\", "/"); right in the beginning of function seems to fix it, perhaps there is a cleaner solution. Windows is kind of weird with paths. Literal "/" in paths could also be replaced with Path.PathSeperator in the whole project (don't know if that would work). (I'm using develop branch).

Seneral commented 7 years ago

Hm thanks for the note, never experienced that on Windows 7... What verison are you using? 10? But anyway, as you did already, should be an easy fix:)

Seneral commented 6 years ago

Finally found time to fix this officially, in e47ac3b:)