Last active
August 29, 2015 14:23
-
-
Save peroon/bf215c73bc9da2470759 to your computer and use it in GitHub Desktop.
DOTween 横にスケールしながら縦は0スケールで消える演出
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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