fix: search NetSyncManager in all loaded scenes#363
Merged
Conversation
When multiple scenes are loaded, GetDefaultServerDiscoveryPort() now searches all loaded scenes for NetSyncManager if it's not found in the active scene. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the editor-side server startup flow to correctly derive the default server discovery port even when NetSyncManager exists in a non-active (but loaded) Unity scene, while preserving the active-scene-first priority.
Changes:
- Extend
GetDefaultServerDiscoveryPort()to search all loaded scenes if the active scene doesn’t contain aNetSyncManager. - Keep the active scene as the highest-priority search target.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
STYLY-NetSync-Unity/Packages/com.styly.styly-netsync/Editor/StartPythonServer.cs
Outdated
Show resolved
Hide resolved
Contributor
…#364) * Initial plan * refactor: simplify GetDefaultServerDiscoveryPort scene search loop Co-authored-by: from2001 <387880+from2001@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: from2001 <387880+from2001@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.
Summary
GetDefaultServerDiscoveryPort()previously only searched the active scene. Now it falls back to searching other loaded scenes if NetSyncManager is not found in the active scene.Test plan
🤖 Generated with Claude Code