简体   繁体   English

C# 错误 CS1513

[英]C# Error CS1513

I don't understand what is causing a CS1513 error.我不明白是什么导致了 CS1513 错误。 I'm using Microsoft Visual Studio.我正在使用 Microsoft Visual Studio。

Here's my code:这是我的代码:

using UnityEngine;
using System.Collections;

public class GameStarted : MonoBehaviour {

void GameStartMsg()
{
    Debug.Log("Game started!");
}

That's all I see:这就是我所看到的:

The only thing wrong is you need to add a curly brace to the end of your code at line nine.唯一的错误是您需要在第 9 行的代码末尾添加一个花括号。 That will get rid of the error.这将摆脱错误。 CS1513 error = missing closing bracket. CS1513 错误 = 缺少右括号。

Please attempt to answer questions yourself.请尝试自己回答问题。

Googling 'error CS1513' lead to this page as the first result - https://msdn.microsoft.com/en-us/library/83ht1k63%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396谷歌搜索“错误 CS1513”导致此页面作为第一个结果 - https://msdn.microsoft.com/en-us/library/83ht1k63%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396

Grant Winney's comment is correct, missing brace.格兰特温尼的评论是正确的,缺少括号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#,绝对初学者得到 CS1513 C# } 预期错误 - C#, absolute beginner getting CS1513 C# } expected error 使用嵌套的IF语句导致“ CS1513:}预期”错误(Webmatrix中的C#) - Using nested IF statements causing a “CS1513: } expected” error (C# in Webmatrix) CS1513}与嵌入式if语句一起使用while循环时,Linqpad出现预期错误(Linqpad中为c#) - CS1513 } expected error on Linqpad whilst using a while loop with embedded if statements (c# in Linqpad) 第一次使用 c#,它说我有错误 CS1513 - First time using c#, It says I have error CS1513 编译器错误消息:CS1513:} 预期 - Compiler Error Message: CS1513: } expected @ Html.Partial引发CS1513:}预期错误 - @Html.Partial Throws CS1513: } expected Error 错误CS1513:}在asp.net mvc 4中预期 - error CS1513: } expected in asp.net mvc 4 错误 CS1513:} 预期和 CS1022:预期文件结束 - 但文件对我来说看起来不错 - Error CS1513: } expected & CS1022: End-of-file expected - But file looks fine to me 清理编译,但运行时错误:ASP.NET CS1513:}页面上的预期错误 - Clean compile, but run-time error: ASP.NET CS1513: } expected error on page 学习 Unity 中的保存和加载; 由于未知原因遇到错误 CS1513 - Learning about Saving and Loading in Unity; encountered error CS1513 for unknown reason
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM