Version: 2017.3

WaitForSecondsConstructor

切换到手册
public WaitForSeconds (float seconds);

描述

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

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { IEnumerator Example() { print(Time.time); yield return new WaitForSeconds(5); print(Time.time); } }