From 2f4bcdf64dd6930d281822510d42a5e93262232f Mon Sep 17 00:00:00 2001 From: James Frowen Date: Sun, 30 Aug 2020 23:44:57 +0100 Subject: [PATCH] Update sync/index.md --- doc/Guides/Sync/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Guides/Sync/index.md b/doc/Guides/Sync/index.md index 13d854784..a5d1b90c8 100644 --- a/doc/Guides/Sync/index.md +++ b/doc/Guides/Sync/index.md @@ -62,7 +62,7 @@ Use the `initialState` flag to differentiate between the first time a game objec The `OnSerialize` function should return true to indicate that an update should be sent. If it returns true, the dirty bits for that script are set to zero. If it returns false, the dirty bits are not changed. This allows multiple changes to a script to be accumulated over time and sent when the system is ready, instead of every frame. -The `OnSerialize` function is only called for `initialState` or when the `NetworkBehavior` is dirty. A `NetworkBehavior` will only be dirty if a `SyncVar` or `SyncObject` (e.g. `SyncList`) has changed since the last OnSerialize call. After data has been sent the `NetworkBehavior` will not be dirty again until the next `syncInterval` (set in the inspector). A `NetworkBehavior` can also be marked as dirty by manually calling `SetDirtyBit` (this does not bypass the syncInterval limit). +The `OnSerialize` function is only called for `initialState` or when the `NetworkBehaviour` is dirty. A `NetworkBehaviour` will only be dirty if a `SyncVar` or `SyncObject` (e.g. `SyncList`) has changed since the last OnSerialize call. After data has been sent the `NetworkBehaviour` will not be dirty again until the next `syncInterval` (set in the inspector). A `NetworkBehaviour` can also be marked as dirty by manually calling `SetDirtyBit` (this does not bypass the syncInterval limit). Although this works, it is usually better to let Mirror generate these methods and provide [custom serializers](../DataTypes.md) for your specific field.