Customizing Behavior
There are settings and attributes unique to SyncTypes which allow various ways of customizing your SyncType.
Last updated
There are settings and attributes unique to SyncTypes which allow various ways of customizing your SyncType.
Last updated
can be initialized with any SyncType to define the default settings of your SyncType.
Settings can also be changed at runtime. This can be very useful to change behavior based on your game mechanics and needs, or to even slow down send rate as your player count grows.
SyncTypes can also be shown in the inspector.
You must first make sure your type is marked as serializable if a container; this is a Unity requirement.
Next the SyncType must not use the 'readonly' indicator. We require the readonly indicator by default to emphasis you should not initialize your SyncType at runtime.
Below is an example of what NOT to do.
The code above will actually prevent compilation in the editor as our code generators will detect you did not include the readonly indicator. To remove the readonly indicator you must also add the above your SyncType.