【问题标题】:Error Assets/qwe.cs(22,35): error CS1525: Unexpected symbol `<internal>' Unity3D错误资产/qwe.cs(22,35): 错误 CS1525: Unexpected symbol `<internal>' Unity3D
【发布时间】:2014-09-27 17:48:58
【问题描述】:

代码有什么问题?谢谢。

using UnityEngine;
using System.Collections;

public class qwe : MonoBehaviour {
    public GameObject cube;
    public float speed=500;
    GameObject zxc;

    // Update is called once per frame
    void Update () {
        if(Input.GetButtonUp("Jump")){
            GameObject CUBE = (GameObject)Instantiate(cube, transform.position, transform.rotation);
            CUBE.rigidbody.AddForce(new Vector3(-speed,0,0));
        }
    }

    void OnCollisionEnter (Collision theCollision)
    {
        if(theCollision.gameObject.name == “cube”)
        {
            Destroy(theCollision.gameObject);
            Debug.Log(“We have hit the wall”);
        }
    }

}

【问题讨论】:

  • 代码是否真的包含那些不正确 “cutesy”-quotes?如果是这样,请修复它们,使它们看起来像 "this"。另外,第 22 行是哪一行?
  • 如果你从头数数,那就是第 22 行。

标签: c# unity3d


【解决方案1】:

使用这些“”引号:

Debug.Log("We have hit the wall");

而不是“”引号:

Debug.Log(“We have hit the wall”);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-10
    • 2021-06-26
    • 2021-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-11
    相关资源
    最近更新 更多