如何在PC上调试Xna 4.0游戏
我对 Windows 上的 Xna 4.0 游戏开发非常陌生,发现很难在 VS 2010 中调试。我真的很想在运行游戏时看到我的变量值。有什么办法可以调试吗?我将 此 视为调试插件。但是,我不确定这是否适用于 VS 2010。是否有任何其他加载项或任何解决方法?我正在 Windows 7 上工作。感谢您的帮助。
I am very new to Xna 4.0 game development on Windows and finding it hard to debug in VS 2010. I really want to see my variable values while I am running the game. Is there any way you can debug? I see this as a debugging add-in. However, I am not sure If that would work with VS 2010. Is there any other add-in or any workaround? I am working on Windows 7. thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以只在屏幕上绘制您想要看到的变量。查看此链接:
http://msdn.microsoft.com /en-us/library/bb447673(XNAGameStudio.10).aspx
You could just draw the variables you want to see on the screen. Check out this link:
http://msdn.microsoft.com/en-us/library/bb447673(XNAGameStudio.10).aspx
这与XNA无关。当应用程序运行时,您在 VS2010 中看不到任何变量值。 VS 如何知道要显示哪些变量?
出于调试目的,您可以在代码中使用 Debug.Writeline 在运行时将变量的值写入控制台。这样您就可以跟踪您选择的变量的值。
This has nothing to do with XNA. You can't see any variable values in VS2010 while the application is running. How would VS know, what variables to display?
For debugging purposes you can use Debug.Writeline in your code to write the value of the variable to the Console while running. That way you can track values of variables of your choice.