Skip to content
Draft
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a1fac91
chore: optimization
noellie-velez Dec 24, 2025
b1b85ac
chore: optimize NetworkManager accessors
noellie-velez Dec 29, 2025
0a28480
Merge branch 'develop-2.0.0' into chore/simplify-accessors-network-ob…
noellie-velez Dec 29, 2025
606c9f7
Using m_CachedNetworkObject instead of NetworkObject
noellie-velez Dec 29, 2025
18a1805
Using m_CachedNetworkManager instead of NetworkManager
noellie-velez Dec 29, 2025
7a49a9a
Convert "==" to explicit Unity engine object lifetime check
noellie-velez Dec 29, 2025
7d9ffd5
Fix wording
noellie-velez Dec 29, 2025
b255749
Use m_CachedParent and Scene
noellie-velez Dec 29, 2025
0ebab51
Changed parentObject scope
noellie-velez Dec 29, 2025
a166482
Removing comments (added in PR)
noellie-velez Dec 29, 2025
f817796
Revert null check removal for Log
noellie-velez Dec 29, 2025
e8d6053
Avoiding breaking change
noellie-velez Jan 5, 2026
43cc1cd
Reverting NetworkManager changes
noellie-velez Jan 5, 2026
25e9577
Address PR feedback
noellie-velez Jan 6, 2026
73a0bf8
Fix opposite null check
noellie-velez Jan 7, 2026
3f17e83
Address PR feedback
noellie-velez Jan 8, 2026
e02e462
Cleanup NetworkObject: use cached NetworkManager
noellie-velez Jan 8, 2026
690cabb
Cached NetworkManager instead of lazy instantiation
noellie-velez Jan 8, 2026
6860816
Merge branch 'develop-2.0.0' into chore/simplify-accessors-network-ob…
noellie-velez Jan 8, 2026
db9b406
Merge branch 'chore/simplify-accessors-network-object' into chore/sim…
noellie-velez Jan 9, 2026
815d310
Comments
noellie-velez Jan 9, 2026
10f258e
Merge branch 'develop-2.0.0' into chore/simplify-accessors-misc
noellie-velez Jan 19, 2026
e1fbce0
Removing comment
noellie-velez Jan 19, 2026
a32d7e5
Use cached NetworkManager in NetworkAnimator
noellie-velez Mar 16, 2026
f3e4361
Add and use cached NetworkManager in RigidbodyBase
noellie-velez Mar 16, 2026
ab880f8
Merge branch 'develop-2.0.0' into chore/simplify-accessors-misc
noellie-velez Mar 16, 2026
aa487f1
Add base call to overrides
noellie-velez Mar 16, 2026
54264cb
Fix wrong NetworkMangerOwner usage
noellie-velez Mar 16, 2026
39e476f
TMP
noellie-velez Mar 16, 2026
4fb8d37
Clean up NetworkBehavior
noellie-velez Mar 18, 2026
e1b2a4c
clean up
noellie-velez Mar 18, 2026
8417846
Fix styling and Wrongly used Owner
noellie-velez Mar 18, 2026
cf4783c
Remove exception
noellie-velez Mar 18, 2026
0bb1acf
Merge branch 'chore/simplify-accessors-misc' of https://github.com/Un…
noellie-velez Mar 19, 2026
8633386
Merge branch 'develop-2.0.0' into chore/simplify-accessors-misc
noellie-velez Mar 23, 2026
2c6fbc9
Reset NetworkAnimator - changes are in another PR
noellie-velez Mar 23, 2026
2a144a7
Merge branch 'chore/simplify-accessors-misc' of https://github.com/Un…
noellie-velez Mar 23, 2026
4e48d49
Reset NetworkRigidBodyBase
noellie-velez Mar 23, 2026
0775e8b
Reset NetworkTransform
noellie-velez Mar 23, 2026
97365a9
Reset NetworkBehavior
noellie-velez Mar 23, 2026
c4ec49b
Reset NetworkSpawnManager
noellie-velez Mar 23, 2026
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
13 changes: 8 additions & 5 deletions com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private void CheckForInScenePlaced()
/// <param name="destroy">Defaults to true, determines whether the <see cref="NetworkObject"/> will be destroyed.</param>
public void DeferDespawn(int tickOffset, bool destroy = true)
{
// Ensure we log the DAMode message first as locking ownership is not allowed if not DA so the DA message is the most relevant.
// The DAMode message is logged first, as ownership locking isn’t allowed when not in DAMode, making it the most relevant message.
if (!NetworkManager.DistributedAuthorityMode)
{
if (NetworkManager.LogLevel <= LogLevel.Error)
Expand Down Expand Up @@ -606,7 +606,7 @@ internal void RemoveOwnershipExtended(OwnershipStatusExtended extended)
/// <returns>true or false depending upon lock operation's success</returns>
public bool SetOwnershipLock(bool lockOwnership = true)
{
// Ensure we log the DAMode message first as locking ownership is not allowed if not DA so the DA message is the most relevant.
// The DAMode message is logged first, as ownership locking isn’t allowed when not in DAMode, making it the most relevant message.
if (!NetworkManager.DistributedAuthorityMode)
{
if (NetworkManager.LogLevel <= LogLevel.Error)
Expand Down Expand Up @@ -1154,8 +1154,11 @@ public bool HasOwnershipStatus(OwnershipStatus status)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool InternalHasAuthority()
{
var networkManager = NetworkManager;
return networkManager.DistributedAuthorityMode ? OwnerClientId == networkManager.LocalClientId : networkManager.IsServer;
if (!IsSpawned)
{
return false;
}
return NetworkManagerOwner.DistributedAuthorityMode ? OwnerClientId == NetworkManagerOwner.LocalClientId : NetworkManagerOwner.IsServer;
}

/// <summary>
Expand Down Expand Up @@ -3541,7 +3544,7 @@ internal void SceneChangedUpdate(Scene scene, bool notify = false)
OnMigratedToNewScene?.Invoke();

// Only the authority side will notify clients of non-parented NetworkObject scene changes
if (isAuthority && notify && !transform.parent)
if (isAuthority && notify && transform.parent == null)
{
NetworkManagerOwner.SceneManager.NotifyNetworkObjectSceneChanged(this);
}
Expand Down