使い方はこんな感じ。Tweenをx秒後に実行したり、Tween完了時に別の関数を呼ぶことができる。uGUIから導入されたRectTransformの要素、anchoredPositionやImageの要素のアニメーションに対応している。
using UnityEngine; using UnityEngine.UI; using System.Collections; using DG.Tweening; public class DOTweenTest : MonoBehaviour { void Start () { GameObject image = GameObject.Find ("Image"); RectTransform rectTransform = image.GetComponent<RectTransform> (); // rect position rectTransform.DOAnchorPos (new Vector2 (100, 0), 5.0f); // rect scale rectTransform.DOScale (new Vector3 (2, 2, 2), 5.0f); // image color rectTransform.GetComponent<Graphic> ().DOColor (Color.red, 5.0f); // rect rotation rectTransform.DORotate (new Vector3 (0, 0, 45), 5.0f); // timer // .SetDelay(1.0f); }