Skip to content

Instantly share code, notes, and snippets.

@Templar2020
Created September 22, 2015 00:14
Show Gist options
  • Save Templar2020/3b9a5f3a67d808479f33 to your computer and use it in GitHub Desktop.
Save Templar2020/3b9a5f3a67d808479f33 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class CoinPickup : MonoBehaviour {
public int pointsToAdd;
void OnTriggerEnter2D (Collider2D other)
{
if(other.GetComponent<PlayerController>()== null)
return;
ScoreManager.AddPoints(pointsToAdd);
Destroy (gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment