UEA0013: UseNonAllocMethods

October 2, 2019 ยท View on GitHub

PropertyValue
IdUEA0013
CategoryGC
SeverityWarning
Version5.3 ->

Example

Code with Diagnostic

using UnityEngine;

class Example : MonoBehaviour
{
    void Start()
    {
        Physics2D.CircleCastAll(Vector2.zero, 5, Vector2.one);
    }
}

Code with Fix

using UnityEngine;

class Example : MonoBehaviour
{
    void Start()
    {
        var results = new RaycastHit2D[X];
        Physics2D.CircleCastNonAlloc(Vector2.zero, 5, Vector2.one, results);
    }
}