Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceExceptions when selecting or deselecting a scriptable object with the SOVariant attribute. #20

Open
simonstix opened this issue Jan 27, 2023 · 1 comment

Comments

@simonstix
Copy link

I'm using Unity 2022.1.6 with Odin 3.1.10

I think this is caused by some change in Odin. In line 56 in SOVariantAttributeProcessor.cs Property.Tree.SerializedObject is null.

I was able to fix this by replacing the line with:

_soVariant = new SOVariant<T>(ValueEntry.SmartValue);

I'm not sure if this could cause other problems because SmartValue has some additional logic by Odin.

@GieziJo
Copy link
Owner

GieziJo commented Jan 3, 2024

Hy @Nonakesh

Sorry for taking so long for getting back to this!

I've made significant changes to the package, it broke all the time, mostly because of the unity importer being too clunky fro the data to be saved in the metadata. I've moved saving the parent/child structure from the metadata to a scriptable object library.

I've at the same time updated everything to Unity 2022.3.16 and Odin 3.2.1.0.

I am still testing the new code, but if you'd like to have a look, you can access it here: https://github.com/GieziJo/ScriptableObjectVariant.git#SOData

I've also written some code to update the system from the old one to the new package (c.f. upgrade guid).

I haven't seen this error since, but will keep it in mind if it pops up.

Thanks a lot!

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

No branches or pull requests

2 participants