Skip to content

Instantly share code, notes, and snippets.

@peroon
Last active August 29, 2015 14:23
Show Gist options
  • Save peroon/bf215c73bc9da2470759 to your computer and use it in GitHub Desktop.
Save peroon/bf215c73bc9da2470759 to your computer and use it in GitHub Desktop.
DOTween 横にスケールしながら縦は0スケールで消える演出
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
public class DOTweenText : MonoBehaviour {
void Start () {
// stretch vertically
this.GetComponent<RectTransform> ().DOScaleY (1.4f, 0.2f).SetLoops(2, LoopType.Yoyo).OnComplete(Vanish);
}
// then, stretch horizontally and vanish
public void Vanish(){
this.GetComponent<RectTransform> ().DOScaleX (2, 1.0f);
this.GetComponent<RectTransform> ().DOScaleY (0, 1.0f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment