19 lines
419 B
C#
19 lines
419 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Infrastructure.Unity
|
|
{
|
|
public class OrbViewAdapter : MonoBehaviour
|
|
{
|
|
public event Action OnCollected;
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.TryGetComponent<PlayerController>(out var player))
|
|
{
|
|
OnCollected?.Invoke();
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|
|
} |