Closed jcjveraa closed 4 years ago
I think it's because you have an infinite loop here 😅the name of the property is tile
, which is also what your return in the getter.
C# property names should be UPPER_CASE
, and should be backed by a private field.
... Good point. Had not been doing C# for a while. Weird that the compiler/linter does not see this and that in runtime it causes unity to completely crash rather than throwing some 'too many references' error.
I guess this can be closed :)
Op wo 22 apr. 2020 22:50 schreef Giora Guttsait notifications@github.com:
I think it's because you have an infinite loop here 😅the name of the property is tile, which is also what your return in the getter.
C# property names should be UPPER_CASE, and should be backed by a private field.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/colyseus/colyseus-unity3d/issues/114#issuecomment-618032919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6CPHPTFLKDLTQJFRJTECLRN5KAHANCNFSM4MDIQ5DA .
Nice, good catch @gioragutt, gonna close this, then :)
When I use a class in unity generated by the colyseus codegen tool, unity crashes to desktop if I use the generated clas as a property with a getter/setter and I try to immediately register the onChange event to a listener, it crashes Unity to desktop.
I use Unity 2019.3.7f1, and behavior is consistent - also with other classes deriving from Schema.
Classes:
Working fine
Should be the same, but crashes: