这个是官方的文档,下面结合协程简单的测试下
using UnityEngine;
using System.Collections;
public class MyYield : MonoBehaviour {
// Use this for initialization
bool isCango = true;
void Start () {
// StartCoroutine(GoandWait());
StartCoroutine(testFrame());
}
IEnumerator testFrame() {
yield return new WaitForEndOfFrame();
// yield return null;
//yield return new WaitForFixedUpdate();
Debug.LogError("this is update over");
}
IEnumerator GoandWait() {
while (true) {
yield return new WaitForSeconds(3f);
float startTime = Time.time;
float endTime = startTim