Add initial project files and configurations for Unity setup
This commit is contained in:
19
Assets/Scripts/Infrastructure/Unity/OrbViewAdapter.cs
Normal file
19
Assets/Scripts/Infrastructure/Unity/OrbViewAdapter.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user