//Transform的DoMove方法拓展 public static Tween DoMove(this Transform transform, Vector3 target, float duration) { MonoBehaviour mono = transform.GetComponents <MonoBehaviour>()[0]; Tween tween = new Tween("DoMove", target, duration, transform, null); Coroutine coroutine = mono.StartCoroutine(mono.DoMove(tween)); tween.setCoroutine(coroutine); return(tween); }
public static Tween DoMove(this Transform transform, Vector3 target, float duration) { MonoBehaviour mono = transform.GetComponent <MonoBehaviour>(); Tween tween = new Tween(transform, duration); tween.target = target; Coroutine co = mono.StartCoroutine(mono.DoMove(tween)); tween.SetCoroutine(co); return(tween); }