Unity: Can't change SpriteResolver with script

Viewed 528

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.

Unity Editor on 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);
0 Answers
Related