System.Threading.Thread.Sleep(Milliseconds);
//wait 2 seconds
Thread.Sleep(2000);
Task.Delay(2000);
//Both are valid options but Task.Delay() can be used with the async keyword
void Start()
{
StartCoroutine(waiter());
}
IEnumerator waiter()
{ //more just scroll down
transform.position = new Vector3(0, 0, 0);
yield return new WaitForSeconds(4);
transform.position = new Vector3(1, 5, 0);
}
void Start()
{
StartCoroutine(waiter());
}
IEnumerator waiter()
{
//Rotate 90 deg
transform.Rotate(new Vector3(90, 0, 0), Space.World);
//Wait for 4 seconds
yield return new WaitForSeconds(4);
//Rotate 40 deg
transform.Rotate(new Vector3(40, 0, 0), Space.World);
//Wait for 2 seconds
yield return new WaitForSeconds(2);
//Rotate 20 deg
transform.Rotate(new Vector3(20, 0, 0), Space.World);
}
void Start()
{
StartCoroutine(waiter());
}
IEnumerator waiter()
{
yield return new WaitForSeconds(4);
}
dataGridView1.Rows[x1].Cells[y1].Style.BackColor = System.Drawing.Color.Red;
dataGridView1.Refresh();
System.Threading.Thread.Sleep(1000);