Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Coin : MonoBehaviour
  6. {
  7.  
  8. void OnTriggerEnter2D(Collider2D other)
  9. {
  10. if (other.gameObject.tag == "Player")
  11. {
  12. Destroy(gameObject);
  13. other.GetComponent<Score>().points++;
  14. }
  15.  
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement