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
fix: OnValueChanged not being triggered on collections when the collection changes back to the previous value (#3539)
https://jira.unity3d.com/browse/MTTB-1421fixes: #3534
## Changelog
- Fixed: When calling `CheckDirtyState(true)` on a `NetworkVariable`
collection, `OnValueChanged` now triggers on the authority if the
authority has changed the collection and then changed it back to the
initial state in the same frame. This matches the behaviour of
non-collection NetworkVariables.
## Testing and Documentation
- Includes unit tests.
- Includes integration tests.
## Backport
Backported by #3544
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
16
16
17
17
### Fixed
18
18
19
+
- Fixed ensuring OnValueChanged callback is still triggered on the authority when a collection changes and then reverts to the previous value in the same frame. (#3539)
19
20
- Fixed synchronizing the destroyGameObject parameter to clients for InScenePlaced network objects. (#3514)
20
21
- Fixed distributed authority related issue where enabling the `NetworkObject.DestroyWithScene` would cause errors when a destroying non-authority instances due to loading (single mode) or unloading scene events. (#3500)
@@ -245,9 +266,9 @@ public override bool IsDirty()
245
266
{
246
267
// If the client does not have write permissions but the internal value is determined to be locally modified and we are applying updates, then we should revert
247
268
// to the original collection value prior to applying updates (primarily for collections).
// If the client does not have write permissions but the internal value is determined to be locally modified and we are applying updates, then we should revert
309
330
// to the original collection value prior to applying updates (primarily for collections).
// If the client does not have write permissions but the internal value is determined to be locally modified and we are applying updates, then we should revert
351
372
// to the original collection value prior to applying updates (primarily for collections).
0 commit comments