Skip to content

Instantly share code, notes, and snippets.

@liveasnotes
Created December 15, 2019 06:40
Show Gist options
  • Select an option

  • Save liveasnotes/fef92e984b40913f709236e8b93c9cbe to your computer and use it in GitHub Desktop.

Select an option

Save liveasnotes/fef92e984b40913f709236e8b93c9cbe to your computer and use it in GitHub Desktop.
[Unity] 1秒毎に実行する
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