Skip to content

Instantly share code, notes, and snippets.

@0V
Last active December 21, 2017 08:30
Show Gist options
  • Save 0V/3f4abb0d0ad8b0fb08afb56824d82755 to your computer and use it in GitHub Desktop.
Save 0V/3f4abb0d0ad8b0fb08afb56824d82755 to your computer and use it in GitHub Desktop.
[SerializeField]
private float speed = 10f;
void Update () {
transform.Translate (speed * Time.deltaTime, 0, 0);
}
[SerializeField]
private float interval = 10f;
[SerializeField]
private float tmpTime = 0;
void Update () {
tmpTime += Time.deltaTime;
if(tmpTime >= interval){
// 10秒ごとに行いたい処理を
// ここに書く
// ...
tmpTime = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment