I purchased NGUI a few weeks ago, and I am extremely pleased! It is very well designed and easy to use. Thanks for the great library.
In addition to my UI and gameplay, I am using NGUI for all of my particle effects.
For example, an explosion effect has 5 frames of animation data. Using UISpriteAnimation, I can get the desired effect I want.
However, it was not perfect, so I made changes locally to the NGUI library in order to get the behavior I want. My question is: Is there a better way to do this? If not, is it possible to request this type of functionality for a future version of NGUI?
Here is what I added:
- Ability to set a non-looping UISpriteAnimation (single-shot) - The explosion should play once and then stop.
- Public interface to query for when the animation is done playing - When the explosion is done playing, some other code looks at the “IsDone” flag and destroys the particle effect. (This could also be done with SendMessage, but I opted with the flag for performance reasons).
- Public interface for resetting the animation to the first frame - All of my particle effects are pooled, so when an explosion is destroyed, it is recycled and used later, so I need to reset the animation.
Is this the correct way to approach this, or is there a better way? If not, is it possible to request this functionality?
Thanks for reading!