- Home /
Unsupported type Generic Mono when using Serializable
Hello everybody,
I have encountered an error I do not understand. The only mention of this was in this Unity Forums thread, no solution there.
The error is: Unsupported type Generic Mono
It happens after adding a [System.Serializable] to a simple class.
Unity seems to be running as usual, but this error appears whenever I try to edit one of the properties that belong to this class in the inspector.
This is my serializable class:
[System.Serializable]
public class EmitterNode {
public GameObject emitter;
public int weight = 1;
}
Any idea what am I doing wrong?
EDIT:
Unity version: 3.5.6f4 on Windows
Target platform: Web Player
Imports in the class where the error happens: UnityEngine, System.Collections and System.Collections.Generic
The error occurs in the editor, immediately after I edit one of the values in that serialized class.
Here is a short screencast:
Weird, this should totally work. Have you tried rena$$anonymous$$g the vars and see what happens? Also, could you show what imports are you using?
I will try rena$$anonymous$$g the variables. But what is "could you show what imports are you using"?...
What is the current target platform your Unity project is set to? I'm not sure but it may be a Flash problem.
"could you show what imports are you using" means what are the "using" statements in your code.
When does this error occur? Compile? Run? In use, or in the Editor? And what is the exact version of Unity you are using?
Thanks both, updated my question with the additional details.
Answer by Demigiant · Oct 04, 2012 at 04:54 PM
Wow a screencast! Just gave your question an upvote just for that :)
That said, from the bold text in your screencast, I see you're editing a prefab. I think what might've happened is that you changed a class (by adding the System.Serializable attribute) that was already "virtually" serialized - at least in part - while attached to a gameObject. Try to remove the Sequencer component from the gameObject you're editing, and then re-attaching it and trying editing. That should fix it.
Heh :) Thanks for both the upvote and the answer, it actually fixed it.
So what is it I should avoid now to prevent it from happening? Should I avoid editing the class after I added the Serializeable attribute?
Changing the classes that are contained (or that represent) a serialized object (even if it's not directly serialized) can always mess them up if they're already instantiated in the editor. You can indeed change the code in a serialized class, but if you change one of the serialized fields, it is best to reset its relative components after that (or at least if you get errors). A thing which is usually best done by removing and re-creating them (Unity's "Reset Component" command is not as failsafe).
A good question and a good answer. This is the sort of info UnityAnswers was built to hold. Upvotes for all.
Thanks $$anonymous$$ark (saw your comment a little late :P)
Your answer
![](https://koobas.hobune.stream/wayback/20220613081852im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why does my Unity Serialization not work? Do i miss something? 1 Answer
Unable to create a Unity Project with HDRP. 0 Answers
I get errors when I start any project 0 Answers
Editor GUI error 0 Answers