Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
- Fixed NetworkLists not populating on client. NetworkList now uses the most recent list as opposed to the list at the end of previous frame, when sending full updates to dynamically spawned NetworkObject. The difference in behaviour is required as scene management spawns those objects at a different time in the frame, relative to updates. (#2062)
- Fixed NetworkList Value event on the server. PreviousValue is now set correctly when a new value is set through property setter. (#2067)
- Fixed NetworkList issue that showed when inserting at the very end of a NetworkList (#2099)
- Fixed Owner-written NetworkVariable infinitely write themselves (#2109)
Comment thread
jeffreyrainy marked this conversation as resolved.
Outdated

## [1.0.0] - 2022-06-27

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,18 @@ internal void PostNetworkVariableWrite()
MarkVariablesDirty(false);
}

internal void VariableUpdate(ulong targetClientId)
internal void PreVariableUpdate()
{
if (!m_VarInit)
{
InitializeVariables();
}

PreNetworkVariableWrite();
}

internal void VariableUpdate(ulong targetClientId)
{
NetworkVariableUpdate(targetClientId, NetworkBehaviourId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ internal void NetworkBehaviourUpdate(NetworkManager networkManager)
{
foreach (var dirtyObj in m_DirtyNetworkObjects)
{
for (int k = 0; k < dirtyObj.ChildNetworkBehaviours.Count; k++)
{
dirtyObj.ChildNetworkBehaviours[k].PreVariableUpdate();
}

for (int i = 0; i < networkManager.ConnectedClientsList.Count; i++)
{
var client = networkManager.ConnectedClientsList[i];
Expand All @@ -56,6 +61,10 @@ internal void NetworkBehaviourUpdate(NetworkManager networkManager)
{
if (sobj.IsOwner)
{
for (int k = 0; k < sobj.ChildNetworkBehaviours.Count; k++)
{
sobj.ChildNetworkBehaviours[k].PreVariableUpdate();
}
for (int k = 0; k < sobj.ChildNetworkBehaviours.Count; k++)
{
sobj.ChildNetworkBehaviours[k].VariableUpdate(NetworkManager.ServerClientId);
Expand Down