Skip to content

Conversation

EmandM
Copy link
Collaborator

@EmandM EmandM commented Jun 11, 2025

Continues the work from @Extrys in #3430.

Changelog

  • Added: A PrefabHandler that gives the ability to send data along with object instantiation.
  • Changed: Moved INetworkPrefabInstanceHandler to its own file.

Testing and Documentation

  • Includes unit tests.

Backport

This is a new feature so no backport is needed

Extrys added 30 commits April 27, 2025 02:29
…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.
@EmandM EmandM requested a review from a team as a code owner June 11, 2025 15:28
@EmandM EmandM changed the title Feat/sync instantiation data feat: Add ability to send instantiation data to a prefab handler Jun 11, 2025
@Extrys
Copy link
Contributor

Extrys commented Jun 11, 2025

I just saw your new changes, and it feels super clean now.
Tested this branch in my projects using this feature, and Everything works correctly!
👍

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

Just one area I have some questions about...otherwise everything else looks good!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like that we moved this into its own file.
👍

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

With changes discussed during paired session, everything else looks good to me!
:godmode:

@EmandM EmandM enabled auto-merge (squash) June 13, 2025 20:37
@EmandM EmandM merged commit d84313f into develop-2.0.0 Jun 13, 2025
35 checks passed
@EmandM EmandM deleted the feat/sync-instantiation-data branch June 13, 2025 21:59
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 <[email protected]>
Co-authored-by: Amy Reeve <[email protected]>
Co-authored-by: Michał Chrobot <[email protected]>
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.

3 participants