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

public class LevelLoaderButton : MonoBehaviour {
    void Awake()
    {
        Button myButton = GetComponent<Button>();
        LevelLoader levelLoader = GameObject.Find("Level Loader").GetComponent<LevelLoader>();

        myButton.onClick.AddListener(() => {
            levelLoader.Load(myButton.name);
        });
    }
}
