I have a problem with animation not working when I change sprites from Sprite Library Asset with a script. I don't know why animation not working but it work well when I change it in Unity Editor play mode.

Here my script below:
private void SetClotherWithID(
SpriteResolver spriteResolver,
string category,
string label)
{
spriteResolver.SetCategoryAndLabel(category, label);
spriteResolver.ResolveSpriteToSpriteRenderer();
}
I get spriteResolver from GameObject:
SetClotherWithID(footL.GetComponent<SpriteResolver>(),
ConstUtils.CategoryFootL, ConstUtils.LabelFootLQ01);