-
Notifications
You must be signed in to change notification settings - Fork 693
fix: improve manage_scene screenshot capture #600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Scriptwonder
merged 10 commits into
CoplayDev:beta
from
toxifly:fix/manage-scene-screenshot
Jan 24, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
655e8b6
fix: improve manage_scene screenshot capture
toxifly 9cbf039
fix: address PR review feedback for screenshot capture
toxifly 20b9188
fix(unity): resolve screenshot import callback type + FindObjectsOfTy…
toxifly 5acef27
Merge pull request #615 from CoplayDev/beta
msanatan 2c20ddc
chore: bump version to 9.2.0
actions-user 6b1c2c9
Merge pull request #616 from CoplayDev/release/v9.2.0
github-actions[bot] 670a688
Merge remote-tracking branch 'upstream/main' into fix/manage-scene-sc…
toxifly 58ccbe9
Update ManageScene.cs
Scriptwonder 4de0a9e
Update ScreenshotUtility.cs
Scriptwonder e1c99c4
Update error logging in ManageScene.cs
Scriptwonder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 127
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 2371
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 370
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 2302
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 1026
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 812
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 7042
🌐 Web query:
FindObjectsOfType InstanceID sorting Unity documentation💡 Result:
Short answer: Unity's Object.FindObjectsOfType always sorts its results by InstanceID. Use Object.FindObjectsByType with FindObjectsSortMode.None if you don't need sorting (faster). [1][2][3]
Sources:
🌐 Web query:
FindObjectsByType FindObjectsSortMode.None documentation Unity 2023.1💡 Result:
FindObjectsByType is documented in the Unity 2023.1 Scripting API. Use the FindObjectsSortMode.None option to return results unsorted (fastest, order not guaranteed).
Key points
Example
Sources
[1] Unity Scripting API — Object.FindObjectsByType (2023.1).
[2] Unity Scripting API — FindObjectsSortMode.None.
[3] Unity Scripting API — Object.FindObjectsOfType (notes on deprecation and behavior).
Preserve deterministic selection when only returning first match.
FindObjectsSortMode.Noneproduces unsorted results, whereas the previousFindObjectsOfTypealways returns results sorted by InstanceID. Since the code returns only the first match whenfindAllis false (line 211), this sorting change can alter which object is selected. To preserve legacy behavior, useFindObjectsSortMode.InstanceIDwhenfindAllis false.🔧 Suggested adjustment
`#if` UNITY_2023_1_OR_NEWER var inactive = searchInactive ? FindObjectsInactive.Include : FindObjectsInactive.Exclude; + var sortMode = findAll ? FindObjectsSortMode.None : FindObjectsSortMode.InstanceID; - searchPoolComp = UnityEngine.Object.FindObjectsByType(componentType, inactive, FindObjectsSortMode.None) + searchPoolComp = UnityEngine.Object.FindObjectsByType(componentType, inactive, sortMode) .Cast<Component>() .Select(c => c.gameObject); `#else` searchPoolComp = UnityEngine.Object.FindObjectsOfType(componentType, searchInactive) .Cast<Component>() .Select(c => c.gameObject); `#endif`📝 Committable suggestion
🤖 Prompt for AI Agents