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

public class PlayerSelect : MonoBehaviour {

	public Button scientistButton;
	public Button pirateButton;

	// Use this for initialization
	void Start () {
		
        scientistButton.GetComponent<Button>().onClick.AddListener(StartScientist);
        pirateButton.GetComponent<Button>().onClick.AddListener(StartPirate);
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	void StartScientist() {
		Gameplay gameplay = GetComponentInParent<Gameplay>();
		gameplay.StartGame("scientist");

		gameObject.SetActive(false);
	}
	void StartPirate() {
		Gameplay gameplay = GetComponentInParent<Gameplay>();
		gameplay.StartGame("pirate");	

		gameObject.SetActive(false);
	}
}
