Content-Length: 21302 | pFad | https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/WaitForSecondsRealtime.html
Suspends the coroutine execution for the specified real (unscaled) time in seconds.
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); } }
See Also MonoBehaviour.StartCoroutine.
| Property | Description |
|---|---|
| waitTime | The given amount of seconds that the yield instruction will wait for. |
| Constructor | Description |
|---|---|
| WaitForSecondsRealtime | Creates a yield instruction to wait for a given number of seconds using unscaled time. |
| Property | Description |
|---|---|
| keepWaiting | Indicates if coroutine should be kept suspended. |
Fetched URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/WaitForSecondsRealtime.html
Alternative Proxies: