- edited description
Can serialize recursive class
Issue #438
resolved
I have class.
[Serializable]
public class AttackCord
{
public AttackEnum attackPoint;
public bool isTargeted;
public AttackCord[] childAttack;
}
Inspector for that class looks like this:
But when I recompile code then I can add child with no problem:
but in child nested level I get this error again:
Is this an error or I should do something?
Unity 2018.3 Odin 2.0.5 Whit and without editor only. Windows 10
Comments (3)
-
reporter -
- changed status to resolved
This is not a bug, but how things actually work. You are likely getting a console error from Unity as well, warning of a recursive serialization loop. What you want to do here is remove the [Serializable] attribute from the class, and make sure only Odin is serializing it by checking the serialization debugger.
-
reporter I don't get any errors, but your solution works thanks!
- Log in to comment