我得到了統一5此錯誤消息錯誤CS1525:意外的符號`插入變量名稱',期望`。'
錯誤CS1525:意外的符號
insert variable name', expecting
「。
using UnityEngine;
using System.Collections;
public class jumpControll : MonoBehaviour
{
public bool jump;
public float jumpHeight;
// Use this for initialization
public IEnumerator jumpUp (float jumpHeight)
{
jumpHeight = 3.0f;
transform.position = new Vector3(transform.position.x,
transform.position.y + jumpHeight, transform.position.z);
}
public IEnumerator jumpDown (float jumpHeight)
{
jumpHeight = 3.0f;
transform.position = new Vector3(transform.position.x,
transform.position.y - jumpHeight, transform.position.z);
}
public IEnumerator jumpTest()
{
jumpUp(float jumpHeight);
yield return new WaitForSeconds(1);
jumpDown(float jumpHeight);
}
// Update is called once per frame
void Update()
{
jump = Input.GetKey(KeyCode.Space);
if (jump == true)
jumpTest();
}
}
錯誤發生在哪裏?什麼行號/字符位置?它發生在構建時間還是運行時間? – Necoras