我开始在Unity中运行脚本,并在运行所附代码之后。我在统一控制台中收到错误。对我有任何帮助。
统一图像错误。
这是我在VS中为统一运行的代码。
在此处输入代码
**using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Debug.Log("Start method is Called");
}
// Update is called once per frame
void Update()
{
Debug.Log("Update is calling");
}
}**
您在项目中有2个名为CubeScript的类。其错误原因
如果其他脚本包含相同的类名称,请查看其他脚本
为了避免重复的类,您也可以添加名称空间:
namespace NameOfSceneForExample
{
public class CubeScript : MonoBehaviour
{
}
}