Collectible.cs 371 B

12345678910111213141516171819
  1. using UnityEngine;
  2. public class Collectible : MonoBehaviour
  3. {
  4. void OnTriggerEnter(Collider other)
  5. {
  6. if (other.CompareTag("Player"))
  7. {
  8. if (GameManager.Instance != null)
  9. {
  10. GameManager.Instance.AddOrb();
  11. }
  12. //Maybe Play A Sound Here?
  13. Destroy(gameObject);
  14. }
  15. }
  16. }