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

public class MenuManagerScript : MonoBehaviour
{

    public Button mainGame, credits /*movementSandbox*//*, fencingSandbox*/;

    void Start()
    {
        // Button btn = mainGame.GetComponent<Button>();
        // btn.onClick.AddListener(TaskOnClick);
        mainGame.onClick.AddListener(OnClick_MainGame);

        if(credits != null)
        {
            credits.onClick.AddListener(OnClick_Credits);
        }
        //    movementSandbox.onClick.AddListener(OnClick_MovementSandbox);
        // fencingSandbox.onClick.AddListener(OnClick_FencingSandbox);
    }

    void OnClick_MainGame()
    {
        Debug.Log("Clicked: OnClick_MainGame");
        SceneManager.LoadScene("MainGame", LoadSceneMode.Single);
    }

    void OnClick_Credits()
    {
        Debug.Log("Clicked: OnClick_Credits");
        SceneManager.LoadScene("Credits", LoadSceneMode.Single);
    }

    void OnClick_MovementSandbox()
    {
        Debug.Log("Clicked: OnClick_MovementSandbox");
        SceneManager.LoadScene("Credits", LoadSceneMode.Single);
    }

    void OnClick_FencingSandbox()
    {
        Debug.Log("Clicked: OnClick_FencingSandbox");
        SceneManager.LoadScene("CrabFencingSandbox", LoadSceneMode.Single);
    }
}
