Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Collector : MonoBehaviour
- {
- private void OnTriggerEnter2D(Collider2D collision)
- {
- ICollectible collectible = collision.GetComponent<ICollectible>();
- if(collectible != null)
- {
- collectible.Collect();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment