Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 脚本错误:'';预期。单位误差_C#_Unity3d - Fatal编程技术网

C# 脚本错误:'';预期。单位误差

C# 脚本错误:'';预期。单位误差,c#,unity3d,C#,Unity3d,在学习教程时,我在这个脚本上出现了这个错误 using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public GameObject prefab; // Instantiate the Prefab somewhere between -10.0 and 10.0 on the x-z plane void Start() {

在学习教程时,我在这个脚本上出现了这个错误

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    public GameObject prefab;

    // Instantiate the Prefab somewhere between -10.0 and 10.0 on the x-z plane
    void Start()
    {
        Vector3 position = new Vector3(Random.Range(-10.0f, 10.0f), 0, Random.Range(-10.0f, 10.0f))
        Instantiate(prefab, position, Quaternion.identity)
    }
}

语句需要用
终止

语句可以由以 分号,或块中的一系列单行语句


Vector3位置=新的Vector3(…) 这就是脚本的外观

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public GameObject prefab;

// Instantiate the Prefab somewhere between -10.0 and 10.0 on the x-z plane
void Start()
{
    Vector3 position = new Vector3(Random.Range(-10.0f, 10.0f), 0, Random.Range(-10.0f, 10.0f));
    Instantiate(prefab, position, Quaternion.identity);
}
}
记住在这行的末尾加“;”

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public GameObject prefab;

// Instantiate the Prefab somewhere between -10.0 and 10.0 on the x-z plane
void Start()
{
    Vector3 position = new Vector3(Random.Range(-10.0f, 10.0f), 0, Random.Range(-10.0f, 10.0f));
    Instantiate(prefab, position, Quaternion.identity);
}
}
这是
c#
。。。每个语句都以
结尾。。。在开始Unity开发之前,也许你应该先学习一些基本的
c
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public GameObject prefab;

// Instantiate the Prefab somewhere between -10.0 and 10.0 on the x-z plane
void Start()
{
    Vector3 position = new Vector3(Random.Range(-10.0f, 10.0f), 0, Random.Range(-10.0f, 10.0f));
    Instantiate(prefab, position, Quaternion.identity);
}
}