【发布时间】:2021-03-15 00:11:20
【问题描述】:
我已尝试使用以下 C# 代码实现统一,但在我标记的大括号上出现 } expected [Assembly-CSharp]csharp(CS1513) 错误,在最后一个大括号上出现 Type or namespace definition, or end-of-file expected [Assembly-CSharp]csharp(CS1022) 错误,当我删除它时它会离开,但它应该结束 Monobehavior 主体。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{ // error here
public static float ScrollWheel { get { return Input.mouseScrollDelta.y / 10; } }
}
} // and also here
【问题讨论】:
-
你不能在方法内创建属性,将你的属性移到方法外
标签: c# unity3d visual-studio-code