Skip to content

Instantly share code, notes, and snippets.

@amimaro
Created March 16, 2018 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amimaro/f1836bf31df1b86f58f2a0600f0b49b6 to your computer and use it in GitHub Desktop.
Save amimaro/f1836bf31df1b86f58f2a0600f0b49b6 to your computer and use it in GitHub Desktop.
Unity Delay Function
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DelayTest : MonoBehaviour
{
bool display = false;
void Start ()
{
StartCoroutine (Delay (3));
}
void Update ()
{
}
IEnumerator Delay (int seconds)
{
display = true;
yield return new WaitForSeconds (seconds);
display = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment