Objects selected by TypeFilter are not saved in scene
1. What happened?
the objects selected using the “TypeFilter” attribute are not saved in the scene or to prefabs
2. How can we reproduce it?
a. Create an abstract class (C1)
b. create one or more classes inheriting from it (C2,C3)
c. Create a var of the base class and attach the TypeFilter Attribute with an enum that returns non-abstract children of the base class (actually use the same code as you have in your documentation)
d. select one of the child classes in the inspector
e. save the scene
*go to another scene and return to the scene where you saved the variable
*close unity and comeback to the scene
*Create a prefab from the object you edited
h. see that the value is reset to initial value as specified in the script
3. If screenshots would help explain or demonstrate your issue, please include these.
4. What version of Unity are you using?
replicated on 2020.1.19 and 2019 LTS (latest)
5. What version of Odin are you using? (See "Tools > Odin Inspector > About")
Replicated in odin 3.0.1 (Latest) and 2.13
6. Do you have Editor Only mode enabled?
7. What operating system are you on?
When attaching ZIP files then please remember to remove Odin from the archive.
ShowInInspector explicitly does not cause anything to be saved, nor should it. See this and this. See this and this for info on serialization.
@Tor Esa Vestergaard
Never in my life was i this thankful to be RTFMd