/// <summary> /// 模拟Dotween /// </summary> /// <param name="args"></param> /// <returns></returns> IEnumerator SimulateDoTween(TweenArgs args) { float timer = 0; while (args.tweenTime > timer) { timer += Time.deltaTime; transform.position = Vector3.Lerp(transform.position, args.targetValue, Time.deltaTime); yield return(new WaitForEndOfFrame()); } OnComplete(args); }
/// <summary> /// 播放列表中的下一个动画 /// </summary> public virtual void ToNextTween() { if (allTween.Count > 0) { TweenEntity data = (TweenEntity)DataEntity; if (data.number >= allTween.Count) { return; } TweenArgs args = allTween[data.number]; data.tweenArgs = args; data.number += 1; } }
/// <summary> /// 动画结束,根据当前完成的动画名字,处理Next事件 /// </summary> /// public virtual void OnComplete(TweenArgs args) { switch (args.tweenName) { case "1": break; case "2": break; case "3": break; default: break; } }