Repository navigation
fix: remove the NetworkObjectBridge when a hybrid prefab stops being hybrid - #4211
NoelStephensUnity wants to merge 16 commits into
Conversation
…hybrid Removing GhostObject from a hybrid prefab now removes only the hidden NetworkObjectBridge and any GhostRigidbody, instead of every GhostBehaviour, and restores SynchronizeTransform. Removing NetworkObject from a hybrid prefab also removes the bridge. The bridge now sets FullTickSmoothing in place of the obsolete SingleWorldHostInterpolationSmoothing.
|
@u-pr please review again |
|
Here is a summary of findings from reviewing the updated changes: 1.
|
…allbacks The GhostObject removal hook now re-runs UnifiedValidation on the next editor tick, so GhostObject and HasGhost match the components on the prefab stage root, and the bridge comes back when the hook fired for a different GhostBehaviour. The deferred add/remove callbacks unsubscribe first and return when their NetworkObject was destroyed.
…modes UnifiedValidation removes a leftover NetworkObjectBridge, so the GhostObjectEditor pre-removal callback is no longer needed. It also fired when the inspection component was removed, and the rebuilt bridge reset SupportedGhostModes. The bridge no longer forces SupportedGhostModes to Interpolated.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop-3.x.x #4211 +/- ##
=================================================
- Coverage 76.03% 75.88% -0.15%
=================================================
Files 159 159
Lines 27344 27402 +58
=================================================
+ Hits 20791 20795 +4
- Misses 6553 6607 +54
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes
|
Removed unused physics-related code and comments.
Removed the ApplyScale method and commented out the current position and rotation logging.
Purpose of this PR
Removing
GhostObjectorNetworkObjectfrom a hybrid prefab now leaves a clean prefab, without the hiddenNetworkObjectBridgeleft behind.Removing
GhostObject: the pre-removal callback now removes only theNetworkObjectBridgeand anyGhostRigidbody, andSynchronizeTransformis enabled again. Previously it destroyed everyGhostBehaviouron the prefab, including user scripts.Removing
NetworkObject: theNetworkObjectBridgenow removes itself when itsNetworkObjectis gone.In-scene placed hybrid instances: the
GhostObjectis now removed through the same path, so the bridge is removed with it.The bridge also now sets
FullTickSmoothingin place of the obsoleteSingleWorldHostInterpolationSmoothing.PR Scope:
NetworkObject,NetworkObjectEditorandNetworkObjectBridge.Out of scope:
GhostBehaviours whenGhostObjectis removed (they belong to the user).GhostRigidbody/ replicate-rigidbody settings whenGhostObjectis removed (N4E owns those).Jira ticket
N/A
Changelog
None (hybrid prefabs require an unreleased N4E version).
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing done: add and removeGhostObjectandNetworkObjecton a hybrid prefab in the inspector, and toggle the Networked checkbox.Automated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?Up-port
Not needed: hybrid prefabs are NGO 3.x only.
Backports
Not needed: hybrid prefabs are NGO 3.x only.