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

public class Goal : MonoBehaviour {

	public GameObject winner;

	// Use this for initialization
	void Start () {
		
	}

	public void OnCollision(Collision other) {
		Debug.Log (other);
		if (other.gameObject.CompareTag ("Player")) {
			winner = other.gameObject;
			GameManager.GM.Win (winner, true);
		}
	}

	public void OnTriggerEnter(Collider other) {
		Debug.Log (other);
		if (other.gameObject.CompareTag ("Player")) {
			winner = other.gameObject;
			GameManager.GM.Win (winner, true);
		}
	}
}
