Last active
December 21, 2017 08:30
-
-
Save 0V/3f4abb0d0ad8b0fb08afb56824d82755 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[SerializeField] | |
private float speed = 10f; | |
void Update () { | |
transform.Translate (speed * Time.deltaTime, 0, 0); | |
} |
This file contains hidden or 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
[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