在运行时同时加载两个场景

Load two scenes at the same time at runtime

我有两个场景。一个带有地图,一个带有按钮和其他东西。 (有点像UI场景)如何通过脚本在运行时同时加载两个场景?

我想我需要类似 Application.LoadLevelAdditive 的东西,但它已经过时了。

SceneManager.LoadScene 就是您要找的。它有 3 个重载:

LoadScene(int sceneBuildIndex);
LoadScene(string sceneName);
LoadScene(int sceneBuildIndex, LoadSceneMode mode);

最后一个是你问题的答案。您可以将模式指定为加法。

using UnityEngine.SceneManagement;
SceneManager.LoadScene(1,LoadSceneMode.Additive);