Skip to content

Instantly share code, notes, and snippets.

@k-kurikuri
Last active February 14, 2017 02:11
Show Gist options
  • Save k-kurikuri/8d0942fef9765ba8ac8d77d7cb24e04e to your computer and use it in GitHub Desktop.
Save k-kurikuri/8d0942fef9765ba8ac8d77d7cb24e04e to your computer and use it in GitHub Desktop.
iTweenを使った数値アニメーションサンプル
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();
}
}
@k-kurikuri
Copy link
Author

spaceインデントにしても、tabになってしまう!
どうしたgist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment