WorldContext

答案是否定的,首先World就不是只有一种类型,比如编辑器本身就也是一个World,里面显示的游戏场景也是一个World,这两个World互相协作构成了我们的编辑体验。然后点播放的时候,引擎又可以生成新的类型World来让我们测试。简单来说,UE其实是一个平行宇宙世界观。
以下是一些世界类型:

namespace EWorldType
{ enum Type
    {
        None, // An untyped world, in most cases this will be the vestigial worlds of streamed in sub-levels Game, // The game world Editor, // A world being edited in the editor PIE, // A Play In Editor world Preview, // A preview world for an editor tool Inactive // An editor world that was loaded but not currently being edited in the level editor };
}

而UE用来管理和跟踪这些World的工具就是WorldContext:

FWorldContext保存着ThisCurrentWorld来指向当前的World。而当需要从一个World切换到另一个World的时候(比如说当点击播放时,就是从Preview切换到PIE),FWorldContext就用来保存切换过程信息和目标World上下文信息。所以一般在切换的时候,比如OpenLevel,也都会需要传FWorldContext的参数。一般就来说,对于独立运行的游戏,WorldCo