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

public enum AvailableScenes {
        MainMenu,
        CompositionMenu,
        QuizzMode,
}

public class ChangeScene : MonoBehaviour
{

    public Button button;
    public AvailableScenes sceneToChange = AvailableScenes.MainMenu;
    readonly Dictionary<AvailableScenes, String> _scenesNames = new Dictionary<AvailableScenes, String>()
    {
        { AvailableScenes.MainMenu, "MainMenu" },
        { AvailableScenes.CompositionMenu, "CompositionMode" },
        { AvailableScenes.QuizzMode, "QuizzMode" },
    };
    // Start is called before the first frame update
    void Start()
    {
        if (button != null)
        {
            button.onClick.AddListener(this.OnClick);
        }
    }

    void OnClick()
    {
        SceneManager.LoadScene(_scenesNames[this.sceneToChange], LoadSceneMode.Single);
    }
}
