WaitForSecondsRealtime
Suspends the coroutine execution for the specified real (unscaled) time in seconds.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: CustomYieldInstruction
- Implements: IEnumerator
public class WaitForSecondsRealtime : CustomYieldInstruction, IEnumerator
Remarks
WaitForSecondsRealtimeyieldTo 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.
Constructors
Constructor | Description |
|---|---|
| WaitForSecondsRealtime(System.Single) | Creates a yield instruction to wait for a given number of seconds using unscaled time. |
Properties
Property | Description |
|---|---|
| waitTime | The given amount of seconds that the yield instruction will wait for. |