Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


WaitForSecondsRealtime

Suspends the coroutine execution for the specified real (unscaled) time in seconds.
Read time 1 minuteLast updated 4 days ago

Definition

public class WaitForSecondsRealtime : CustomYieldInstruction, IEnumerator

Remarks

WaitForSecondsRealtime
can only be used with a
yield
statement in coroutines.
To wait using scaled time, refer to WaitForSeconds.
using UnityEngine;using System.Collections;public class WaitForSecondsExample : MonoBehaviour{ void Start() { StartCoroutine(Example()); } IEnumerator Example() { print(Time.time); yield return new WaitForSecondsRealtime(5); print(Time.time); }}

Constructors

Constructor

Description

WaitForSecondsRealtime(System.Single)Creates a yield instruction to wait for a given number of seconds using unscaled time.

Properties

Property

Description

waitTimeThe given amount of seconds that the yield instruction will wait for.

Inheritance