Property | Value |
---|---|
Id | UEA0004 |
Category | GC |
Severity | Warning |
using UnityEngine;
public class Example : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
// UEA0004: Using CompareTag for tag comparison does not cause allocations
if (other.tag == "Player")
{
}
}
}
public class Example : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
}
}
}