JetBrains / JetBrains/resharper-unity

Deprecated: PreferNonAllocApiAnalyzer

Open
#2,445 4 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.