Search Issue Tracker
Fixed
Fixed in 10.0.3
Votes
0
Found in [Package]
10.0.0-pre.1
Issue ID
DANB-316
Regression
No
"'Object.FindObjectsOfType(Type)' is obsolete" warning is thrown by 2D Sprite Shape Extras "GenerateSpriteShapes.cs" script
Reproduction steps:
1. Open the “ObsoleteExtrasProject“ project
2. Make sure “Assets/Samples/2D SpriteShape” does not exist
3. Open the Package Manager and select the “2D SpriteShape“ package
4. Open the Samples tab and import the “Sprite Shape Extras” sample
5. Observe the Console
Expected result: no “obsolete” warnings are logged
Actual result: a “'Object.FindObjectsOfType(Type)' is obsolete” warning is logged
Reproduced in: 10.0.0-pre.1 (2023.1.0a20, 2023.1.0a23)
Not reproduced in: 5.3.0 (2020.3.42f1), 7.0.6 (2021.3.15f1), 9.0.1 (2022.2.1f1), 10.0.0-pre.1 (2023.1.0a19)
Reproduced using: macOS 13.0.1 (Intel), Windows 11 (by user)
Full warning: “Assets/Samples/2D SpriteShape/10.0.0-pre.1/Sprite Shape Extras/Scripts/GenerateSpriteShapes.cs(21,82): warning CS0618: 'Object.FindObjectsOfType(Type)' is obsolete: 'Object.FindObjectsOfType has been deprecated. Use Object.FindObjectsByType instead which lets you decide whether you need the results sorted or not. FindObjectsOfType sorts the results by InstanceID, but if you do not need this using FindObjectSortMode.None is considerably faster.'“
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Highlighter.Highlight does not find window when using class name as window title
- Highlighter.Highlight highlights a different component when multiple components have the same property path
- Highlighter.Highlight does not find elements in an array or list when the array or list is collapsed
- [URP][NRP] RenderPass, BeginSubPass, and EndRenderPass errors are thrown when Native RenderPass is enabled
- D3D11 swapchain error pop-up appears and the Editor shuts down when Generating Lighting with Probe Volumes present
Resolution Note (fix version 10.0.3):
Fix for this issue is available on 2D SpriteShape package 10.0.3 and above