错误Assets / qwe.cs(22,35):错误CS1525:意外符号“<internal>”Unity3D </internal>

时间:2014-09-27 04:29:36

标签: c# unity3d

代码中的问题是什么?谢谢。

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”);
        }
    }

}

1 个答案:

答案 0 :(得分:1)

使用这些“”引号:

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

而不是“”引号:

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