ScriptableObject-Architecture icon indicating copy to clipboard operation
ScriptableObject-Architecture copied to clipboard

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

Open ahSOLO opened this issue 4 years ago • 1 comments

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.

ahSOLO avatar May 16 '21 05:05 ahSOLO

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!

elFlashor avatar Jul 13 '22 21:07 elFlashor