- changed status to resolved
Serialized Coroutine hide itself when is [ReadOnly] and not null
Issue #775
resolved
- I usually have a specific [TabGroup] in my scripts to visually debug things in real-time, so I give [ReadOnly] properties to fields and follow them. Today I set a Coroutine variable in this tab, but when I apply [ReadOnly] to this variable they disappear when isn’t null. If I remove [ReadOnly] things work properly
- a. Create a Coroutine variable
b. Give [OdinSerialize] attribute to it
c. Give [ReadOnly] attribute to it
d. Pass some coroutine to this variable in runtime -
2020.3.2f1
- 3.0.4.0
- no
- Windows 10
Comments (2)
-
-
reporter The problems isn’t with coroutines being or not serialized, the problem is only that [ReadOnly] attribute is hidden variable value, if I remove the attribute things works just right
- Log in to comment
I'm afraid Coroutine is not a serializable type and contains no information that would be pertinent to display in the inspector; if you want to know anything about the state of the routine, the variable to display would be the IEnumerator instance of the coroutine. The Coroutine value is just a handle for Unity to use.