Last active
February 14, 2017 02:11
-
-
Save k-kurikuri/8d0942fef9765ba8ac8d77d7cb24e04e to your computer and use it in GitHub Desktop.
iTweenを使った数値アニメーションサンプル
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; | |
public class NumCounter : MonoBehaviour | |
{ | |
[SerializeField] | |
private Text _numText; | |
void Start() | |
{ | |
int start = 100; | |
int end = 1; | |
iTween.ValueTo(gameObject, iTween.Hash("from", start, "to", end, "time", 2, "onupdate", "SetNum")); | |
} | |
void SetNum(int num) | |
{ | |
_numText.text = num.ToString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
spaceインデントにしても、tabになってしまう!
どうしたgist