Ejemplo n.º 1
0
 public SceneDirector(
     CoroutineRunner coroutineRunner,
     AvailableScenes availableScenes,
     Fader fader,
     IPlayerChoiceService playerChoiceService)
 {
     this.coroutineRunner     = coroutineRunner;
     this.availableScenes     = availableScenes;
     this.fader               = fader;
     this.playerChoiceService = playerChoiceService;
 }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    public void LoadLevel(AvailableScenes availaibleScene, Action endCallback = null)
    {
        int levelIndex = AvailableSceneToIndex(availaibleScene);

        StartCoroutine(LoadYourAsyncScene(levelIndex, endCallback));
    }
Ejemplo n.º 4
0
    public static void LoadScene(AvailableScenes scene)
    {
        int scene_index = all_scenes.Find((x) => x.Key == scene).Value;

        SceneManager.LoadScene(scene_index);
    }