gpt4 book ai didi

c# - XNA 初始化和 LoadContent 之间的差异

转载 作者:行者123 更新时间:2023-12-03 03:03:46 26 4
gpt4 key购买 nike

Initialize 和 LoadContent 之间有什么区别?我尝试通过将内容从 LoadContent 移动到 Initialize 并返回来阻止 XNA 游戏,但只要您以适当的方式调用事物,无论我将其放在哪里,一切都会正常工作。

最佳答案

documentation for LoadContent指出

This method is called by Initialize

documentation for Initialize

In classes that derive from Game, you need to call base.Initialize in Initialize, which will automatically enumerate through any game components that have been added to Game.Components and call their Initialize methods.

因此,基本初始化方法将在加载任何内容之前初始化游戏组件,LoadContent 方法可确保您的资源在适当的时间加载。

关于c# - XNA 初始化和 LoadContent 之间的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23679759/

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