所以我的代码应该在 3.5 秒后将其打印到控制台,但由于某种原因它从未发生。
我不知道该尝试什么。
这是我的代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class Talking : MonoBehaviour
{
public TextMeshPro t;
public Component talk;
void Start()
{
GetComponent<TextMeshPro>().enableWordWrapping = false;
StartCoroutine("Speech");
}
public IEnumerator Speech()
{
yield return new WaitForSeconds(3.5f);
Debug.Log("yay my code works");
}
}