Skip to content

fix: reset static fields for Fast Enter Play Mode#3956

Open
noellie-velez wants to merge 17 commits into
develop-2.0.0from
chore/fast-enter-playmode
Open

fix: reset static fields for Fast Enter Play Mode#3956
noellie-velez wants to merge 17 commits into
develop-2.0.0from
chore/fast-enter-playmode

Conversation

@noellie-velez
Copy link
Copy Markdown
Collaborator

@noellie-velez noellie-velez commented Apr 24, 2026

Purpose of this PR

Ensure com.unity.netcode.gameobjects package supports Fast Enter Play Mode

Jira ticket

MTT-14665

Changelog

  • Fixed: Netcode for Game Objects now supports Fast Enter Play Mode

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Backports

N/A

Comment thread com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventData.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs Outdated
@noellie-velez noellie-velez marked this pull request as ready for review April 24, 2026 15:06
@noellie-velez noellie-velez requested review from a team as code owners April 24, 2026 15:06
Copy link
Copy Markdown
Contributor

@simon-lemay-unity simon-lemay-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to UnityTransport look good to me.

Comment thread com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs Outdated
@@ -44,6 +44,10 @@ public static class QuaternionCompressor

// Used to store the absolute value of the 4 quaternion elements
private static Quaternion s_QuatAbsValues = Quaternion.identity;
Copy link
Copy Markdown
Collaborator Author

@noellie-velez noellie-velez May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace quaternion by 4 ints

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If replacing this quaternion by 4 ints, we would need to rework the index to skip logic (lines 70 to 95)

Comment thread com.unity.netcode.gameobjects/Runtime/Core/ComponentFactory.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs Outdated
DisableNotOptimizedSerializedType = false;
}

private void Reset()
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add xml doc with:
Used by cref... NetworkManagerHeper this is called by the reset button of the Unity Editor

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not manage to have the correct cref link

Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkUpdateLoop.cs
Comment thread com.unity.netcode.gameobjects/Runtime/Messaging/DeferredMessageManager.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessage.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/Metrics/NetworkMetrics.cs Outdated
@@ -13,6 +16,18 @@ internal class NetworkMetrics : INetworkMetrics
private const ulong k_MaxMetricsPerFrame = 1000L;
private static Dictionary<uint, string> s_SceneEventTypeNames;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be made readonly

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s_FrameDispatch too?

Comment thread com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventData.cs Outdated
internal static readonly int AnimatorControllerParameterInt;
internal static readonly int AnimatorControllerParameterFloat;
internal static readonly int AnimatorControllerParameterBool;
internal static readonly int AnimatorControllerParameterTriggerBool;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not being used, are we missing a cacheValue.Type == AnimationParamEnumWrapper.AnimatorControllerParameterTriggerBool check on ReadParameters function (line 1386)?

/// For debugging delta position and half vector3
/// </summary>
protected delegate void AddLogEntryHandler(ref NetworkTransformState networkTransformState, ulong targetClient, bool preUpdate = false);
protected AddLogEntryHandler m_AddLogEntry;
Copy link
Copy Markdown
Collaborator Author

@noellie-velez noellie-velez May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is m_AddLogEntry being used?

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.

4 participants