WaitForSecondsRealtimeConstructor

Switch to Manual
public WaitForSecondsRealtime (float time);

Description

创建一个 yield 指令,以使用未缩放时间等待指定的秒数。


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); } }