问题描述
这是我在 unity 中的超级简单脚本:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class script : MonoBehavIoUr
{
// Start is called before the first frame update
void Start()
{
Debug.Log("Something");
}
// Update is called once per frame
void Update()
{
}
}
我将脚本附加到主摄像头:
在我运行 unity 游戏后,控制台是 empty
,这意味着脚本不会运行。
这只是我为了测试这个而创建的一个新项目,因为在我原来的项目中,unity 会自发地停止执行脚本。我卸载了旧版本(2019)并安装了新版本(2020)以及 Visual Studio(即使它不是必需的),但没有任何区别。