rabidus-test/Assets/Scripts/CollectionsModule.cs

15 lines
318 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollectionsModule : MonoBehaviour
{
public void OnTriggerCollectItem(Collider other)
{
if (other.TryGetComponent(out IInteractable collectable))
2023-07-24 16:38:13 +03:00
{
collectable.Interact();
2023-07-24 16:38:13 +03:00
}
}
}