using UnityEngine;
using UnityEngine.UI;
public class afterFade : StateMachineBehaviour
{
public Image image;
override public void OnStateExit(UnityEngine.Animator animator, UnityEngine.AnimatorStateInfo animatorStateInfo, int layerIndex)
{
image.gameObject.SetActive(false);
}
}
I confirmed this behavior with a quick test, and now I realize why. Read here:
You are dragging a scene-based object into that field, and that field is stored in the actual animator asset on disk. You can’t have a disk asset referring to something as transient as a scene object, in the same way you can’t drag references to an in-scene prefab into a not-in-scene asset’s property field.