Hi there,
I've been using UIPlayTween and the OnFinished event to chain animations. However, I've seem to come up with a problem for my use case, where OnFinished doesn't seem to be called or gets called at later time when UIPlay triggers an animation that's already finished. I haven't figured out exactly what is going on, but have managed to how to fix it somewhat via a minor modification in UIPlayTween.cs OR UITweener.cs after a little bit of debugging.
I'm using NGUI 3.0.9f4. In UIPlayTween.cs:305, moved the EventDelegate.Add() before the preceding if block (to line 292). Since I suspected the culprit to be stuff happening inside tw.Play() on line 301, another way that I fixed my issue was to, in UITweener.cs, remove the Update() on line 345 inside the Play function. I'm not sure if by doing either of these breaks anything else, but just wanted to pose the question out there. I have a sense that it may have something to do with the event not kicking in because of the edge case that the animation was already done (tweenFactor already == 1), hence the event stuff doesn't kick in (some stuff that's supposed to happen in Update, didn't). I'm not exactly sure, and I've found a working solution for now, so I'll leave it to the expert to correct me or the issue.
I've attached a sample scene that demos the issue (without the NGUI source, of course).
Please let me know if this is legit or if I'm doing something incorrectly. Thanks.