16 lines
385 B
C#
16 lines
385 B
C#
using UnityEngine;
|
|
|
|
public class Goal : MonoBehaviour
|
|
{
|
|
public Team team;
|
|
void OnTriggerEnter2D(Collider2D collision)
|
|
{
|
|
if(collision.gameObject.CompareTag("Player")){
|
|
Debug.Log("GOAL!");
|
|
Ball ball = collision.gameObject.GetComponent<Ball>();
|
|
Debug.Log(ball.name);
|
|
GameManager.instance.OnGoal(team);
|
|
}
|
|
}
|
|
}
|