UEA0010: DoNotUseStateNameInAnimator
October 2, 2019 ยท View on GitHub
| Property | Value |
|---|---|
| Id | UEA0010 |
| Category | Performance |
| Severity | Warning |
Example
Code with Diagnostic
using UnityEngine;
class Example : MonoBehaviour
{
Animator animator;
void Update()
{
animator.SetInteger("Walk", 1);
}
}
Code with Fix
using UnityEngine;
class Example : MonoBehaviour
{
Animator animator;
int walkHash;
void Start()
{
var walkHash = Animator.StringToHash("Walk");
}
void Update()
{
animator.SetInteger(walkHash, 1);
}
}