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: networkvariablebase not being reinitialized if networkobject persists between sessions (#3217)
* fix
Back-port of #3181 final fix.
* test
The test to validate this PR.
* update
Only log something if we have something to log.
* test
remove verbose mode.
* update
adding changelog entry
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
@@ -12,6 +12,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
12
12
13
13
### Fixed
14
14
15
+
- Fixed issue where `NetworkVariableBase` derived classes were not being re-initialized if the associated `NetworkObject` instance was not destroyed and re-spawned. (#3217)
15
16
- Fixed issue where a spawned `NetworkObject` that was registered with a prefab handler and owned by a client would invoke destroy more than once on the host-server side if the client disconnected while the `NetworkObject` was still spawned. (#3202)
16
17
- Fixed issue where `NetworkRigidBody2D` was still using the deprecated `isKinematic` property in Unity versions 2022.3 and newer. (#3199)
17
18
- Fixed issue where an exception was thrown when calling `NetworkManager.Shutdown` after calling `UnityTransport.Shutdown`. (#3118)
Debug.LogWarning($"[{m_NetworkBehaviour.name}][{m_NetworkBehaviour.GetType().Name}][{GetType().Name}][Initialize] {nameof(NetworkManager)} has no {nameof(NetworkTimeSystem)} assigned!");
121
+
}
122
+
}
123
+
124
+
/// <summary>
125
+
/// Deinitialize is invoked when a NetworkObject is despawned.
126
+
/// This allows for a recyled NetworkObject (in-scene or pooled)
127
+
/// to be properly initialized upon the next use/spawn.
128
+
/// </summary>
129
+
internalvoidDeinitialize()
130
+
{
131
+
// When despawned, reset the HasBeenInitialized so if the associated NetworkObject instance
132
+
// is recylced (i.e. in-scene placed or pooled) it will re-initialize the LastUpdateSent time.
0 commit comments