Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: doggan on July 01, 2012, 05:54:38 AM

Title: Non-looping UISpriteAnimation
Post by: doggan on July 01, 2012, 05:54:38 AM
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:

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!
Title: Re: Non-looping UISpriteAnimation
Post by: ArenMook on July 01, 2012, 11:19:33 AM
When designing this feature back in the day I skimmed over it thinking "meh, no one will want to use NGUI like it's 2D Toolkit"... I can ask Phil to take a look into adding these features next week (good suggestions btw!).
Title: Re: Non-looping UISpriteAnimation
Post by: doggan on July 02, 2012, 08:06:31 AM
Awesome! Thanks for the quick response.
Title: Re: Non-looping UISpriteAnimation
Post by: doggan on July 20, 2012, 07:03:44 AM
Thank you for adding this functionality to the 2.1.0 release. :D

However, I tried to use it and I think it is bugged.

In UISpriteAnimation.cs, this:
  1. public bool isDone { get { return mActive; } }

... should be this:
  1. public bool isDone { get { return !mActive; } }

Making this change, it seems to work perfectly.

(Or, the accessor should be renamed from "isDone" to "isPlaying" or "isActive").

Thanks!
Title: Re: Non-looping UISpriteAnimation
Post by: PhilipC on July 20, 2012, 09:49:44 AM
Property is now named isPlaying. Thanks.