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

public class WinScreen : MonoBehaviour
{
    public Text winText;
    private int playerNumber;

	// Use this for initialization
	void Start ()
    {
        playerNumber = FindObjectOfType<PlayerWinstate>().winningPlayer;
        winText.text = "Player   " + (playerNumber+1) + "   wins!";
        winText.gameObject.SetActive(true);
	}

    public void Update()
    {
        if(Input.GetKeyDown("joystick 1 button 1"))
        {
            FindObjectOfType<SceneController>().FadeAndLoadScene("Menu");
        }

        else if(Input.GetKeyDown("joystick 2 button 1"))
        {
            FindObjectOfType<SceneController>().FadeAndLoadScene("Menu");
        }

        else if(Input.GetKeyDown("joystick 3 button 1"))
        {
            FindObjectOfType<SceneController>().FadeAndLoadScene("Menu");
        }

        else if(Input.GetKeyDown("joystick 4 button 1"))
        {
            FindObjectOfType<SceneController>().FadeAndLoadScene("Menu");
        }
    }
}
