Created
October 28, 2017 22:53
-
-
Save JonathanYin/0effc88412d967d0e997c75a377b7ab1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Coin : MonoBehaviour | |
{ | |
public int scoreValue = 25; | |
public GameObject player; | |
public GameObject coin; | |
void OnTriggerEnter (Collider other) | |
{ | |
if (other.tag == "Player") { | |
ScoreManager.score += scoreValue; | |
Destroy (coin); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment