我对这个函数有疑问:
UWorld::SetGameMode
我假设有 3 种游戏模式。我怎样才能在我的代码中访问它们并在游戏开始时将其中之一设置为默认值?执行此操作的最佳方法是什么?
最佳答案
您可以使用自己的UGameInstance
类(在项目设置中设置)。在这个类中你可以覆盖这个方法:
/** Call to create the game mode for a given map URL */
virtual class AGameModeBase* CreateGameModeForURL(FURL InURL);
并提供您希望使用的任何游戏模式类。
关于c++ - 在 GameStart 上更改 GameMode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44669962/