我有两个场景。一个带有 map ,一个带有按钮和其他东西。 (有点像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);
关于c# - 在运行时同时加载两个场景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38538808/