You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In OnStateChangeHandler in Unity, I almost always find myself checking if change.Field matches a constant string before deciding which sub-handler to run. String matching like this is error-prone because issues can't be detected at compile time. This could be resolved by either:
Providing OnChange support to individual fields rather than only on an object-level (I imagine this isn't possible across all Colyseus' platforms), or
Making schema-codegen generate constants for all the field names in the schema, so that they can be used instead of the developer writing out the constant strings themselves.
The text was updated successfully, but these errors were encountered:
In
OnStateChangeHandler
in Unity, I almost always find myself checking ifchange.Field
matches a constant string before deciding which sub-handler to run. String matching like this is error-prone because issues can't be detected at compile time. This could be resolved by either:OnChange
support to individual fields rather than only on an object-level (I imagine this isn't possible across all Colyseus' platforms), orThe text was updated successfully, but these errors were encountered: