Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

I deleted the ScriptableObjects in Assets/DefaultEditorResources/Node_Editor_Framework #199

Closed
TimOgden opened this issue Oct 25, 2021 · 3 comments

Comments

@TimOgden
Copy link

Hey, I was having some trouble with the Node Editor and I tried deleting the ScriptableObjects 'CurSession.asset' and 'LastSession.asset' from the folder Assets/DefaultEditorResources/Node_Editor_Framework.

I'm thinking this caused more issues, since now whenever I try to drag a node to move it or click on a TextField in the node, Unity silently crashes. Perhaps there is another reason for this, but this is my current guess.

I restored the files from the Recycle bin, but now 'CurSession.asset' and 'LastSession.asset' are missing their associated scripts, and I'm not sure what scripts they use. Any help would be appreciated, thanks!

@Seneral
Copy link
Owner

Seneral commented Oct 25, 2021

Deleting them would be my first move as well if you do not care about the data in them, they are just storing the currently opened canvas.
Deleting them should prompt the editor to automatically recreate them, even if it was open. Did that not happen?
Also, what did you do with the window during all this - e.g. delete while the window is closed, etc.?

@TimOgden
Copy link
Author

I deleted them with the window open, tried reloading the canvas, closing and opening the window, and it never recreated the DefaultEditorResources asset files, but I realized that the actual 'CurSession.asset' and 'LastSession.asset' files in Assets/Plugins/Node_Editor_Framework were still working fine, and the Node Editor window still worked fine.

The reason for Unity crashing was that I tried to change the backgroundColor field in Node.cs to be a virtual property which I could override to have different colors for different types of nodes. I instead just added:

void OnEnable() {
    backgroundColor = [whatever color you want it to be]
}

on each of my different extensions of Node.cs.

@Seneral
Copy link
Owner

Seneral commented Oct 25, 2021

Ok then there still might be an issue, it should not switch locations unless you did that by moving them or by changing the settings here.
If you install path is in Assets/, it should have used that path from the beginning, the logic of which can be found here.
The reason it is so complex for a simple cache file path is because it has to be in the Assets folder, so when installed with the unity package manager it will have to be stored outside the Framework folder somewhere in Assets.

Also unity crashing due to virtual properties sounds wrong too. That too might just be an error somewhere in the framework as well, unless unity became a lot more unstable since I last used it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants