Skip to content

fix: [Backport] collection authority OnValueChanged #3544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

EmandM
Copy link
Collaborator

@EmandM EmandM commented Jul 11, 2025

https://jira.unity3d.com/browse/MTTB-1421
fixes: #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

This is a backport of #3539

@EmandM EmandM requested a review from a team as a code owner July 11, 2025 20:18
EmandM added a commit that referenced this pull request Jul 11, 2025
…ction changes back to the previous value (#3539)

https://jira.unity3d.com/browse/MTTB-1421
fixes: #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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NetworkVariable<List<T>>.CheckDirtyState(true) doesn't trigger OnValueChanged when changed back in the same frame
1 participant