Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Tranas on May 10, 2013, 05:58:05 PM
-
So, I'm having an issue with UISpriteAnimation.
I'm not really trying to do anything complicated with it, as I am aware it's just for simple animations.
But I need to swap between different namePrefixes on the fly during Runtime.
_gestureSprite.namePrefix = ArTypes.Sprites.GESTURE_SPRITE_REFERENCES[(int)module.moduleType];
_gestureSprite.Reset();
Where _gestureSprite is a UISpriteAnimation reference and GESTURE_SPRITE_REFERENCES is a string array of NamePrefixes.
They're all stored in the same atlas as well, so it should just be able to find them by the prefix and loop through.
The problem is, the second I try to switch between them at Runtime with this code, it doesn't change sprite and won't animate any longer.
But before that, if I do it through editor - it will find them and animate just find.
I've searched through the forms and surprisingly can't find anyone who is trying to swap namePrefixes at runtime.
So I plead to your assistance.
Thanks again!
-
It's likely something obvious -- like case sensitivity. The prefix is case-sensitive. Put a Debug.Log inside UISpriteAnimation.RebuildSpriteList after it compiles the list. My guess is that it's coming out empty.