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
- Trail Renderer visual doesn't match the positions of vertices when they have been offset
- [Mobile] The Material is not visible when using the Decal Renderer Feature
- Uncaught TypeError: Cannot read properties of undefined is thrown when the tab is inactive for several minutes
- Crash on mono_array_length when building a project
- "StackOverflowException" error when changing spline curve type from "Bezier" to "Auto" in the "Element Inspector"
Resolution Note (fix version 10.0.3):
Fix for this issue is available on 2D SpriteShape package 10.0.3 and above