大家好我是Unity脚本的新手,我不能解决问题请有人帮助我
这是代码:
using UnityEngine;
using System.Collections;
public class testScript : MonoBehaviour
{
int i = 1;
// Use this for initialization
void Start()
{
for (i = 1; i > 6; i++)
{
Debug.Log("value of i = " + i);
}
Debug.Log("i'm out of the loop");
} //the problem is cs1513 c# expected unity here(21.line)
// Update is called once per frame
void Update()
{
}
我使用Microsoft Visual Studio编程
提前致谢!!!
答案 0 :(得分:-1)
您只在脚本末尾缺少}
。最后一个}
应关闭班级{
。这可能是你错误删除的。有时,Unity无法识别脚本更改。如果在进行此修改后仍然存在此问题,只需关闭并重新打开Unity和Visual Studio / MonoDevelop。
using UnityEngine;
using System.Collections;
public class testScript : MonoBehaviour
{
int i = 1;
// Use this for initialization
void Start()
{
for (i = 1; i > 6; i++)
{
Debug.Log("value of i = " + i);
}
Debug.Log("i'm out of the loop");
} //the problem is cs1513 c# expected unity here(21.line)
// Update is called once per frame
void Update()
{
}
}//<====This you missed.