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

Custom types have to be serializable in order for their game events be debuggable in the editor #150

Open
ahSOLO opened this issue May 16, 2021 · 1 comment

Comments

@ahSOLO
Copy link

ahSOLO commented May 16, 2021

I generated a custom type using the code generator and created a custom game event from it. When I tried to view the custom game event in the editor I received a Null Reference Exception from ScriptableObjectArchitecture.Editor.TypedGameEventEditor.GetDebugValueType.

I ended up resolving it by adding System.Serializable to my custom type as suggested here: https://answers.unity.com/questions/274002/using-serializedproperty-on-custom-classes.html

Not sure if others might come across this issue but it might be worthwhile to add a note to the wiki.

@elFlashor
Copy link

Hello,
I've stumbled upon the same issue just tonight, and partially solved it using your suggestion.

However, I still have the issue with one set of Event/Listeners I created, using the System.Guid format as type.
Unfortunately I cannot add anything to that class (obviously) and I'm also fairly sure (I could be wrong here, please correct me if I am) that this type is already serializable as I was able to serialize/deserialize it to and from Json for a disk save purpose.

Is there a way I could solve this? (I just want to avoid the spamming of null reference errors in my console whenever I select one of the assets).

Thanks!

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