Timeline for What's the difference between FindObjectsByType and FindObjectsOfType?
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 12, 2023 at 18:15 | comment | added | DMGregory♦ | Right, because the link that Kevin shared says the warnings will be rolled out starting in version 2023.1, and 2022.3 is less than 2023.1. | |
Aug 12, 2023 at 16:54 | comment | added | huang |
@DMGregory "the old function is going to be changed to throw a warning/error to alert to the mistake". Unfortunately, when I wrote the script, I still didn't see any warnings about FindObjectOfType . I use Unity Editor 2022.3 LTS and Visual Studio 2022.
|
|
Aug 9, 2023 at 14:13 | comment | added | DMGregory♦ |
@huang I'd suspect because they know most game developers will keep using the first thing that comes to hand. If you type the familiar FindObjectsOfType() and it's accepted, you don't tend to go looking for an overload that requires typing more characters. So you end up getting "slow by default", when what we really want is "fast by default". As Kevin's link explains, the old function is going to be changed to throw a warning/error to alert to the mistake, and eventually be removed, so that devs can't accidentally stumble into this performance landmine. I think such minesweeping is good.
|
|
Aug 9, 2023 at 13:51 | comment | added | huang | Why not add a overload with addition parameters? | |
Mar 30, 2023 at 3:15 | comment | added | Kevin | See this comment for an explanation of why they added the new API and the deprecation plan for the old API. | |
Mar 7, 2023 at 19:10 | vote | accept | mustafa candan | ||
Mar 6, 2023 at 17:18 | history | edited | DMGregory♦ | CC BY-SA 4.0 |
Adding explicit tl;dr.
|
Mar 6, 2023 at 15:40 | history | edited | DMGregory♦ | CC BY-SA 4.0 |
Clarifying
|
Mar 6, 2023 at 14:13 | history | answered | DMGregory♦ | CC BY-SA 4.0 |