feat: Add ability to send instantiation data to a prefab handler#3497
Merged
EmandM merged 64 commits intodevelop-2.0.0from Jun 13, 2025
Merged
feat: Add ability to send instantiation data to a prefab handler#3497EmandM merged 64 commits intodevelop-2.0.0from
EmandM merged 64 commits intodevelop-2.0.0from
Conversation
…efabInstanceHandler.Instantiate() documentation
1) Moved the payload deserialization into the AddSceneObject, for deferred instantiation compatibility 2) Changed the new interface to be a direct single extended implementation, instead a complement of the handler 3) Some renames to better match what the feature does for developers
- Added `INetworkPrefabInstanceHandlerWithData`, a variant of `INetworkPrefabInstanceHandler` that supports synchronizing custom data prior to the `Instantiate()` method call. (#3430)
Updates the description of the method that retrieves instantiation data for a NetworkObject.
Prevents instantiation data synchronization failures from propagating, ensuring that exceptions thrown during synchronization are caught and logged, and that resources are properly released. This change improves the robustness of the instantiation process.
Improves prefab handler lookup performance by introducing a dedicated dictionary for handlers with instantiation data. This allows for faster injection of instantiation data into NetworkObjects.
…antiation data length
…/com.unity.netcode.gameobjects into feat/sync-instantiation-data
Contributor
|
I just saw your new changes, and it feels super clean now. |
Member
NoelStephensUnity
left a comment
There was a problem hiding this comment.
Just one area I have some questions about...otherwise everything else looks good!
Member
There was a problem hiding this comment.
I like that we moved this into its own file.
👍
NoelStephensUnity
approved these changes
Jun 12, 2025
Member
NoelStephensUnity
left a comment
There was a problem hiding this comment.
With changes discussed during paired session, everything else looks good to me!
![]()
…/com.unity.netcode.gameobjects into feat/sync-instantiation-data
…ty-Technologies/com.unity.netcode.gameobjects into feat/sync-instantiation-data
5 tasks
NoelStephensUnity
added a commit
that referenced
this pull request
Aug 14, 2025
Documentation for #3497 ## Changelog - Added: Documentation for the Network prefab handler. - Fixed: Updated the Object spawning documentation page to be DA compatible. ## Documentation - Includes documentation for previously-undocumented public API entry points. - Includes edits to existing public API documentation. ## Testing & QA [//]: # ( This section is REQUIRED and should describe how the changes were tested and how should they be tested when Playtesting for the release. It can range from "edge case covered by unit tests" to "manual testing required and new sample was added". Expectation is that PR creator does some manual testing and provides a summary of it here.) ### Functional Testing [//]: # (If checked, List manual tests that have been performed.) _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`? If any boxes above are checked, please add QA as a PR reviewer. ## Backport This is 2.x only documentation update and doesn't need a backport. --------- Co-authored-by: Noel Stephens <noel.stephens@unity3d.com> Co-authored-by: Amy Reeve <amy.reeve@unity3d.com> Co-authored-by: Michał Chrobot <124174716+michalChrobot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the work from @Extrys in #3430.
Changelog
INetworkPrefabInstanceHandlerto its own file.Testing and Documentation
Backport
This is a new feature so no backport is needed