【发布时间】:2015-12-24 16:35:58
【问题描述】:
我正在制作手机游戏,我需要在摧毁物体后显示 5 秒钟的短信。我尝试使用 yield waitforseconds 但不起作用。我也尝试过调用函数。我用行代码 SceneManager.LoadScene ("__Main1"); 创建了一个单独的函数;但我也有同样的问题。
我想显示我的文本 5 秒钟,然后加载新场景。
这是我现在的代码:
void OnTriggerEnter2D (Collider2D other)
{
if (other.gameObject.CompareTag ("bomb")) {
other.gameObject.SetActive (false);
Destroy (this.gameObject);
scoretext.SetActive (true); //this text need to be displayed for 5 seconds after destroying game object
SceneManager.LoadScene ("__Main1");
}
我希望有人可以帮助解决这个问题。谢谢。
【问题讨论】:
标签: unity3d