小编use*_*710的帖子

错误:"名称"...."在当前上下文中不存在"

我是xna的新手,我正在制作一个RPG.当我尝试按项目构建时,我得到错误:

1)当前上下文中不存在名称"component":

if (component is DrawableGameComponent)
   ((DrawableGameComponent)component).Visible = true;
Run Code Online (Sandbox Code Playgroud)

2)当前上下文中不存在名称"content":

LoadContent(content);
Run Code Online (Sandbox Code Playgroud)

"组件"的错误在发现GameScreen类和"内容"的错误在发现启动画面类.

为什么会发生这些错误?它们是什么意思?谢谢.

Game1.cs

namespace myRPG
{
    /// <summary>
    /// Default Project Template
    /// </summary>
    public class Game1 : Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;
        SpriteFont font;

        //hold current state of the keyboard
        KeyboardState keyboardState;
        //hold previous state of the keyboard
        KeyboardState oldKeyboardState;
        //active screen will be set to either startScreen or actionScreen
        GameScreen activeScreen;
        StartScreen startScreen;
        ActionScreen actionScreen;
        CharScreen charScreen;
        ClassScreen …
Run Code Online (Sandbox Code Playgroud)

c# xna xamarin.mac xamarin-studio

0
推荐指数
1
解决办法
4281
查看次数

标签 统计

c# ×1

xamarin-studio ×1

xamarin.mac ×1

xna ×1