예제 #1
0
        //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);
        }
예제 #2
0
파일: Tween.cs 프로젝트: zuokaihuang/Unity
        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);
        }