ok, i didn't explain the whole thing.
I add a script, TweenProgress, to do a job that tween a ProgressBar, and it could assign a value > 1, ex: 3.5, from 0, then it will tween the ProgressBar from 0 and to 1, then set 0, to 1, 3 times and stop at 0.5. I use it to do progress effect like gains EXP and level up.
so it contains 2 callback, one is OnValueChange( and yes, i could just use that one on UIProgressBar, stupid miss ),
and another is OnPass01, called when the progress's value is passed 0 or 1.
This is just A CASE. what my question is :
1. Should we do the same thing like the OnFinish do when we execute a custom eventDelegate list?
if (current == null)
{
UITweener before = current;
current = this;
if (e != null)
{
temp = e;
e
= new List
<EventDelegate
>();
// Notify the listener delegates
EventDelegate.Execute(temp);
// Re-add the previous persistent delegates
for (int i = 0; i < temp.Count; ++i)
{
EventDelegate ed = temp[i];
if (ed != null && !ed.oneShot) EventDelegate.Add(e, ed, ed.oneShot);
}
temp = null;
}
// Deprecated legacy functionality support
if (eventReceiver != null && !string.IsNullOrEmpty(callWhenFinished))
eventReceiver.SendMessage(callWhenFinished, this, SendMessageOptions.DontRequireReceiver);
current = before;
}
2. If so, could the api be added into UITweener?
If we don't have to, then it's okay that i could just execute the callback list. ( should I set the current? i think it will happen the loop issue you mentioned if i don't. )