Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 672 Bytes

File metadata and controls

48 lines (36 loc) · 672 Bytes

UEA0010: DoNotUseStateNameInAnimator

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);
    }
}