init
This commit is contained in:
15
Assets/Scripts/Goal.cs
Normal file
15
Assets/Scripts/Goal.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user