When I start the editor one of the classes, a ScriptableObject, is not recognized. Loading
fails silently, there is nothing in the log, I just can’t use it from scripts. The instances of it
are still present in custom asset containers but selecting them shows that label in the
inspector: “Couldn’t load script, fix compile errors.”
I have many similar classes which are working fine, the only special thing about this class
is that I finished developing it after the 4.3 update.
If right after startup I put a space somewhere in the .cs file and force a recompile that way
then things work once again.
It does not load the instance of that particular class so it becomes null in the Object array.
At least until I force a recompile. The issue seems to be limited to asset management as
I can always create new instances in the scene.
If I browse the custom asset container in Unity’s Hierarchy view then I can see all SO instances
except the ones which are having the issue. The weird thing is that I can manually pick the
class it is complaining about:
Hmm, interesting that you mention it. For a while I was using the dll version of this plugin but
debugging was difficult so I moved onto using the source version long before updating to 4.3.
I double checked and there is nothing else in there anymore for DLL building, I fully removed
that feature.
Okay, here is what’s happening: if the class was added from Visual Studio then the problem
occurs, however if the class was created in Unity then it’s fine.
i have the exact same problem with a class created by myself inside Unity. At every startup the created assets lose their reference to the ScriptableObject class they represent. i dont have namespaces nor do i use dll’s.
And it’s fixed if i manually re-assign it from the inspector.
Edit: i think i found the solution for my specific problem - The ScriptableObject derived class needed to be in its own .cs file. If i appended it to another file it would do the above. But now it works.
Bumping thread.
I’m having the same problem. I tried putting every ScriptableObject derived class to its own .cs script, and it works but only in editor, but… all my SO always have missing reference on startup. Pressing play, however, fixes it and throughout that Unity session, it’ll always remember the reference.
The problem comes when I try it on build. It seems like that “missing reference” on startup also happens on the build, but this time it doesn’t “fix” it.