【发布时间】:2022-01-01 09:46:23
【问题描述】:
当我在写我的代码时,我在第 6 行收到一个错误,我错过了一个“}”。当我在那里放一个 } 时,它告诉我应该放一个 { 代替。由于我是 Unity 开发的新手,我可能只是愚蠢并没有看到问题,但如果您需要,这里是完整的错误消息:Assets\Scripts\Difficulty.cs(16,6): error CS1513: } 预期的。这里也是代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Difficulty : MonoBehaviour
{
[SerializeField]
public int difficulty;
[SerializeField]
float time;
float timer = 0;
// Start is called before the first frame update
void Start()
{
public bool updated = false;
float timer = time;
}
// Update is called once per frame
void Update()
{
if (time < 0)
{
updated = true;
difficulty++;
}
}
}
【问题讨论】:
标签: c#