ReSharper 2026.1 Help

代码检查:项目中没有同名的动画状态。

此检查会报告传递给 Animator.Play(...) 的动画状态名称在项目中未找到任何已知动画状态。

仅当启用资源索引并且 Unity 资源以文本格式可用时,该检查才有效,因为它需要从项目资源中读取动画状态名称。

示例

在此示例中,使用了 "Attack" 状态名称,但在已索引的项目资源中不存在该名称。

using UnityEngine; public class Example : MonoBehaviour { public Animator animator; private void Start() { // Reported: "Attack" state not found in animator assets animator.Play("Attack"); } }
using UnityEngine; public class Example : MonoBehaviour { public Animator animator; private void Start() { // Use an animator state that exists in the project animator.Play("Idle"); } }

快速修复

此检查不提供专用的快速修复。 请手动使用已有的动画状态名称进行修正。

2026年 5月 8日