gpt4 book ai didi

XNA Zune HD 应用程序无法正常退出

转载 作者:行者123 更新时间:2023-12-02 09:00:29 25 4
gpt4 key购买 nike

我已经构建并部署了由 zune hd 的新项目模板创建的应用程序。问题是每当应用程序退出时,Zune 就会重新启动。从 PC 远程调试或直接从设备运行时会发生这种情况。它发生在 Debug模式和 Release模式下。我已经包含了基本的模板代码,但它非常通用。大家有什么想法吗?

public class DrawGame : Microsoft.Xna.Framework.Game
{
private GraphicsDeviceManager m_graphics;
private SpriteBatch m_spriteBatch;

public DrawGame()
{
m_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";

TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
}

protected override void Initialize()
{
base.Initialize();
}

protected override void LoadContent()
{
m_spriteBatch = new SpriteBatch(GraphicsDevice);
}

protected override void UnloadContent()
{ }

protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
{
this.Exit();
}

base.Update(gameTime);
}

protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);

m_spriteBatch.Begin();
m_spriteBatch.End();

base.Draw(gameTime);
}
}

最佳答案

这实际上是设计使然,而不是您做错了什么。

参见MSDNthis blog

The features that become disabled are the playback of DRM music and the ability to share content with other Zunes (outside of game information). The reason we do this is we want to keep the Zune secure while you’re writing your games on the device. The only way for us to re-enable these features is to restart the device

关于XNA Zune HD 应用程序无法正常退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1621843/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com