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

public class MainMenuButton : MonoBehaviour
{
    public GameObject player;
    void Awake() 
    {
        // if (GameObject.Find("MusicPlayer(Clone)"))
        // {
        //     Destroy(GameObject.Find("MusicPlayer(Clone)"));
        // }

        if (GameObject.Find("MusicPlayer(Clone)") == null && player != null)
        {
            Instantiate(player);
        }
    }

    void OnMouseDown() 
    {
        if (this.name == "ButtonStart")
        {
            SceneManager.LoadScene("Game");
        }
        else
        {
            Application.Quit();
        }    
    }
}
