Answers for "how to make a line of code wait c#"

C#
14

how to wait in c#

System.Threading.Thread.Sleep(Milliseconds);
Posted by: Guest on July-02-2020
0

how to make a line of code wait c#

//In the example below the script will right "Hello" and 3 seconds later write "Goodbye" in the console
Start()
{
  	//Call the function Example()
	StartCoroutine(Example());
}

Example()
{
  	Console.WriteLine("Hello");
  	//wait 3 seconds
	yield return new WaitForSeconds(3);
  	Console.WriteLine("Goodbye");
}
Posted by: Guest on September-30-2020

Code answers related to "how to make a line of code wait c#"

C# Answers by Framework

Browse Popular Code Answers by Language