Advertisement
Beg_Productions

CoinPickUp

Oct 11th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.31 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class CoinPickUp : MonoBehaviour {
  5.  
  6.     public int pointsToAdd;
  7.  
  8.     void OnTriggerEnter (Collider other)
  9.     {
  10.         if (other.GetComponent<GroundedCharacterController> () == null)
  11.             return;
  12.  
  13.         ScoreManager.AddPoints (pointsToAdd);
  14.         Destroy (gameObject);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement