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

public class Ziel : MonoBehaviour {

    public Image player1WinScreen;
    public Image player2WinScreen;


    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Player1")
            player1WinScreen.gameObject.SetActive(true);
        if (other.gameObject.tag == "Player2")
            player2WinScreen.gameObject.SetActive(true);

    }

   void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
            SceneManager.LoadScene(0);
            
    }
 
}
