Created
March 16, 2018 14:19
-
-
Save amimaro/f1836bf31df1b86f58f2a0600f0b49b6 to your computer and use it in GitHub Desktop.
Unity Delay Function
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 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