Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 624 Bytes

File metadata and controls

41 lines (31 loc) · 624 Bytes

UEA0005: DoNotUseFindMethodsInUpdate

Property Value
Id UEA0005
Category Performance
Severity Warning

Example

Code with Diagnostic

using UnityEngine;

public class Example : MonoBehaviour
{
    void Update()
    {
        // UEA0005: Warning to cache the result of find in Start or Awake
        GameObject.Find("");
    }
}

Code with Fix

using UnityEngine;

public class Example : MonoBehaviour
{
    GameObject cachedObj;

    void Start()
    {
        cachedObj = GameObject.Find("");
    }
}