using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class abcdef : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
UnityEngine.Debug.LogError("666666");
UnityEngine.Debug.Log("666666");
}
}
这么一个简单的代码中,Update却只运行一次,原因是什么呢?
原因有可能是:使用了UnityEngine.Debug.LogError("666666");
LogError有break或者return的效果,一般新下载的unity是没有自带这个效果,但是可以在编辑器里修改,如果不慎修改了某个选项,它就会产生break的效果。改成UnityEngine.Debug.Log("666666");
就可以了。