public void FinishAll(IEnumerable <TweenBase> tweens) { Queue <KeyValuePair <TweenBase, float> > queue = new Queue <KeyValuePair <TweenBase, float> >(); foreach (var tween in tweens) { queue.Enqueue(Util.MakePair(tween, float.MaxValue)); } TweenHelper.UpdateQueue(queue, this); }
private void UpdateWithDelta(float deltaTime, float unscaledDeltaTime) { Queue <KeyValuePair <TweenBase, float> > queue = new Queue <KeyValuePair <TweenBase, float> >(); foreach (var tween in tweens_) { queue.Enqueue( Util.MakePair(tween, tween.ignoreTimeScale ? unscaledDeltaTime : deltaTime)); } TweenHelper.UpdateQueue(queue, this); }
public void FinishAll(GameObject owner) { if (tweens_obj_map_.ContainsKey(owner)) { Queue <KeyValuePair <TweenBase, float> > queue = new Queue <KeyValuePair <TweenBase, float> >(); foreach (var tween in tweens_obj_map_[owner]) { queue.Enqueue(Util.MakePair(tween, float.MaxValue)); } TweenHelper.UpdateQueue(queue, this); } }
internal override bool OnUpdate(float delta_time, out float remain_time) { while (true) { Queue <KeyValuePair <TweenBase, float> > queue = new Queue <KeyValuePair <TweenBase, float> >(); foreach (var tween in running_tweens_) { queue.Enqueue( Util.MakePair(tween, delta_time)); } float minRemainTime = TweenHelper.UpdateQueue(queue, this); if (running_tweens_.Count == 0) { if ((--repeat_cnt_dynamic_) == 0) { remain_time = minRemainTime; return(true); } else { delta_time = minRemainTime; Restart(); } } else { break; } } remain_time = 0; now_time_ += delta_time; if (timeLimit > 0 && now_time_ >= timeLimit) { remain_time = now_time_ - timeLimit; if (finishAllWhenTimeout) { Finish(); } else { Cancel(); } return(true); } else { remain_time = 0; return(false); } }
public bool FinishTween(TweenBase tween) { if (running_tweens_.Contains(tween) && tween.isRunning) { Queue <KeyValuePair <TweenBase, float> > queue = new Queue <KeyValuePair <TweenBase, float> >(); queue.Enqueue(Util.MakePair(tween, float.MaxValue)); TweenHelper.UpdateQueue(queue, this); return(true); } else { return(false); } }
public bool FinishTween(TweenBase tween) { if (tweens_.Contains(tween) && tween.isRunning) { Queue <KeyValuePair <TweenBase, float> > queue = new Queue <KeyValuePair <TweenBase, float> >(); queue.Enqueue(Util.MakePair(tween, float.MaxValue)); TweenHelper.UpdateQueue(queue, this); return(true); } else { Debug.LogWarning("[Box.Tween] tween is not running in this handler!"); return(false); } }