Unity Scenes 3: Loading Scenes Additively

preview_player
Показать описание
How to load multiple scenes at the same time, both through script and while working in the editor. Talks about some of the challenges of working with multiple scenes in Unity.
Рекомендации по теме
Комментарии
Автор

Just gonna thank you right away, it will be needed for our group, so i am glad that someone showed how and that it is an option in Unity :D

patrikomelka
Автор

Your deserve 1MILLION Subscribers, thanks for your support!

jakenirmal
Автор

i have plenty of questions lol

at the end you say that on our main scene we would have our player character and logic and on others additive scenes we would have actual geometry

does it mean we would have all the colliders and triggers and stuff on the main scene and only the actual meshes in additive scenes ?

also how does the light interacts between scenes when loaded additively ? does the game prioritize the directional light from the main scene or does it "override" it with the one from the new scenes ?
does this also affects the skybox ?

im guessing this would only affect dynamic lighting since baked lighting would be scene-dependant

zedty
Автор

I'm having a bizarre issue where, when the Additive scene is loaded, it loads several times in the hierarchy. I only have the second scene unloaded in one instance on my hierarchy, but the moment the scene loads, the engine loads five of them. Do you know what the issue is here?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class OpenDoorBar : MonoBehaviour {

public float TheDistance;
public AudioSource CreakSound;
public GameObject fadeOut;
public GameObject Raquel;
public GameObject CameraBack;

void OnTriggerStay (Collider other)
{
if (Input.GetButton("Use"))
{

CreakSound.Play();
}
}


IEnumerator FadeToExit()
{
fadeOut.SetActive(true);
yield return new WaitForSeconds(1);
Raquel.transform.position = new Vector3(0.6f, 0.6f, -6.3f);

fadeOut.SetActive(false);
SceneManager.LoadScene(3, LoadSceneMode.Additive);
}
}

stuffedmannequin