protected void Awake() { if (Application.isPlaying) { sceneSemaphore = SceneSemaphore.Create(sceneToLoad); } }
public static SceneSemaphore Create(SceneReference sceneToLoad) { if (allSemaphores.ContainsKey(sceneToLoad.ScenePath)) { return(allSemaphores[sceneToLoad.ScenePath]); } else { var sceneSemaphore = new SceneSemaphore(sceneToLoad); allSemaphores.Add(sceneToLoad.ScenePath, sceneSemaphore); return(sceneSemaphore); } }