JetBrains / JetBrains/resharper-unity
Deprecated: PreferNonAllocApiAnalyzer
- Dominant language
- C#
- Stars
- 1.2k
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
Referring to the analysis code in resharper/resharper-unity/src/Unity/CSharp/Daemon/Stages/Analysis/PreferNonAllocApiAnalyzer.cs
Unity no longer recommends this but the opposite. Following this inspection will lead to broken code in the future as Unity deprecates these functions. This also caused some unneeded refactors.
Notice of deprecation from Unity:
[[Physics2D](https://docs.unity3d.com/ScriptReference/Physics2D.html)].[[OverlapAreaNonAlloc](https://docs.unity3d.com/ScriptReference/Physics2D.OverlapAreaNonAlloc.html)]
> Get a list of all Colliders that fall within a specified area. Note: This method will be deprecated in a future build and it is recommended to use [OverlapArea](https://docs.unity3d.com/ScriptReference/Physics2D.OverlapArea.html) instead.
Recommended action in Project Settings or script:
[[Reuse Collision Callbacks](https://docs.unity3d.com/ScriptReference/Physics2D-reuseCollisionCallbacks.html)]
Contributor guide
Assessment
This issue has not been assessed yet.