Created
December 15, 2019 06:40
-
-
Save liveasnotes/fef92e984b40913f709236e8b93c9cbe to your computer and use it in GitHub Desktop.
[Unity] 1秒毎に実行する
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
| using UnityEngine; | |
| public class ExecEverySecond : MonoBehaviour | |
| { | |
| float dt = 0; | |
| void Update() | |
| { | |
| dt += Time.deltaTime; | |
| if (dt > 1) | |
| { | |
| dt = 0.0f; | |
| // do something | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment