15 lines
277 B
C#
15 lines
277 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class Goal : MonoBehaviour
|
|
{
|
|
public Action OnGoalReached;
|
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if (other.gameObject.CompareTag("Player"))
|
|
{
|
|
OnGoalReached?.Invoke();
|
|
}
|
|
}
|
|
} |