Question by
hoanjizi · Sep 10, 2020 at 05:19 AM ·
animationscripting problemsprite
Can't change SpriteResolver with script
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);
screen-shot-2020-09-10-at-121716.png
(28.5 kB)
Comment
Your answer
Follow this Question
Related Questions
Sprite animation cannot be play when player retry Unity 0 Answers
Texture not centered in sprite 0 Answers
Need help Script error, i got 4 errors here is my script 1 Answer
[C#]How to save a list of items to use in another script and it's not a player prefs type of list? 0 Answers
NEED HELP ANIMATING PLAYER MOVEMENT 0 Answers