public SceneDirector( CoroutineRunner coroutineRunner, AvailableScenes availableScenes, Fader fader, IPlayerChoiceService playerChoiceService) { this.coroutineRunner = coroutineRunner; this.availableScenes = availableScenes; this.fader = fader; this.playerChoiceService = playerChoiceService; }
public int AvailableSceneToIndex(AvailableScenes availableScenes) { int returnIndex = 0; switch (availableScenes) { case AvailableScenes.MAIN_SCREEN: returnIndex = 0; break; case AvailableScenes.LEVEL_1: returnIndex = 1; break; case AvailableScenes.CREDITS: returnIndex = 2; break; default: break; } return(returnIndex); }
public void LoadLevel(AvailableScenes availaibleScene, Action endCallback = null) { int levelIndex = AvailableSceneToIndex(availaibleScene); StartCoroutine(LoadYourAsyncScene(levelIndex, endCallback)); }
public static void LoadScene(AvailableScenes scene) { int scene_index = all_scenes.Find((x) => x.Key == scene).Value; SceneManager.LoadScene(scene_index); }