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
- Silent crash when clicking in Scene View in a specific project
- The Player renders black on a Quest headset when MSAA, Post Processing, and Spacewarm depth submission are enabled
- Graphics Compositor breaks Unity rendering when the "Output Camera" is changed to a scene Camera and one Camera SubLayer is active
- The Editor freezes on RenderGraphViewer.Repaint when entering too many characters in search fields without character limits
- Adding a new SubLayer in Graphics Compositor renders BaseLayer darker and makes it flicker
Resolution Note (fix version 10.0.3):
Fix for this issue is available on 2D SpriteShape package 10.0.3 and above