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
2k stars 415 forks source link

`PlayModeStateChange' could not be found. Are you missing a using directive or an assembly reference? #186

Closed Scannell24 closed 4 years ago

Scannell24 commented 4 years ago

Getting some errors trying to import this into a blank unity project.

Diving into EditorApplication shows a playmodeStateChanged function but PlayModeStateChange seems to be a variable so I'm not sure if there's a relation

Using Unity 5.4.2f2

Perhaps my folder structure is off? image

Seneral commented 4 years ago

This is a unity version issue, the playmodeStateChanged callback has been renamed from 2017.2 onward. To make it compatible between versions it should look like this.

However it seems that I forgot this version checking in UndoPro. Will fix tomorrow, have to install an older unity version again first. If you want a quick fix, just implement a similar construct as in the file linked above (with a wrapper function around the older function signature) in this UndoPro script.

Reminds me I should use that new functionality of the new function signature to replace the mess in EditorLoadingControl, at least in newer unity versions. I'm suprised someone still starts projects in Unity 5. Any reason for this, out of curiosity? There might be a lot of other errors like this, I honestly am not entirely sure, since I did not pay too much attention to keeping more than a few versions of backwards compability.

Seneral commented 4 years ago

Fixed in UndoPro and verified that it works. NEF also needs slight fixing, will do that now.

Seneral commented 4 years ago

And done, see following commits: NEF: 19840d2 UndoPro: 94c375e

In addition to that, if you need to go even farther back (pre 5.5), you might need to convert the serialization version of each relevant asset manually (only stuff like save files, etc). I made a script for that a while back, check it out here.