Пример #1
0
 /// <summary>
 /// 一次来回
 /// </summary>
 private void Repeatedly(Transform from, Transform to)
 {
     CacheTransform.localPosition    = from.localPosition;
     CacheTransform.localEulerAngles = from.localEulerAngles;
     CacheTransform.localScale       = from.localScale;
     CacheTransform.DOLocalMove(to.localPosition, duration).OnComplete(() => CacheTransform.DOLocalMove(from.localPosition, duration));
     CacheTransform.DOLocalRotate(to.localEulerAngles, duration, RotateMode.FastBeyond360).OnComplete(() => CacheTransform.DOLocalRotate(from.localEulerAngles, duration));
     CacheTransform.DOScale(to.localScale, duration).OnComplete(() => CacheTransform.DOScale(from.localScale, duration));
 }
Пример #2
0
 /// <summary>
 /// 循环
 /// </summary>
 private void Loop(Transform from, Transform to)
 {
     CacheTransform.localPosition    = from.localPosition;
     CacheTransform.localEulerAngles = from.localEulerAngles;
     CacheTransform.localScale       = from.localScale;
     CacheTransform.DOLocalMove(to.localPosition, duration).OnComplete(() => OnFinished(() => Loop(from, to)));
     CacheTransform.DOLocalRotate(to.localEulerAngles, duration, RotateMode.FastBeyond360).OnComplete(() => OnFinished(() => Loop(from, to)));
     CacheTransform.DOScale(to.localScale, duration).OnComplete(() => OnFinished(() => Loop(from, to)));
 }
Пример #3
0
 /// <summary>
 /// 循环来回
 /// </summary>
 private void PingPong(Vector3 from, Vector3 to)
 {
     CacheTransform.DOLocalMove(to, duration).OnComplete(() => PingPong(to, from));
 }
Пример #4
0
 /// <summary>
 /// 一次来回
 /// </summary>
 private void Repeatedly(Vector3 from, Vector3 to)
 {
     CacheTransform.localPosition = from;
     CacheTransform.DOLocalMove(to, duration).OnComplete(() => CacheTransform.DOLocalMove(this.from, duration));
 }
Пример #5
0
 /// <summary>
 /// 循环
 /// </summary>
 private void Loop(Vector3 from, Vector3 to)
 {
     CacheTransform.localPosition = from;
     CacheTransform.DOLocalMove(to, duration).OnComplete(() => Loop(this.from, to));
 }
Пример #6
0
 /// <summary>
 /// 一次
 /// </summary>
 private void Once(Vector3 from, Vector3 to)
 {
     CacheTransform.localPosition = from;
     CacheTransform.DOLocalMove(to, duration).OnComplete(() => onFinished());
 }
Пример #7
0
 /// <summary>
 /// 循环来回
 /// </summary>
 private void PingPong(Transform from, Transform to)
 {
     CacheTransform.DOLocalMove(to.localPosition, duration).OnComplete(() => OnFinished(() => PingPong(to, from)));
     CacheTransform.DOLocalRotate(to.localEulerAngles, duration, RotateMode.FastBeyond360).OnComplete(() => OnFinished(() => PingPong(to, from)));
     CacheTransform.DOScale(to.localScale, duration).OnComplete(() => OnFinished(() => PingPong(to, from)));
 }