Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using UnityEngine;
- public class Gem : MonoBehaviour, ICollectible
- {
- public static event Action OnGemCollected;
- // Example of using particles
- //public ParticleSystem collectParticle;
- public void Collect()
- {
- OnGemCollected?.Invoke();
- // This is where you can play sounds or spawn particles
- //Instantiate(collectParticle, transform.position, Quaternion.identity);
- Debug.Log("Gem collected!");
- Destroy(gameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment