using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PickUpCoin : MonoBehaviour {
public static AudioSource PickUpCoins;
public int Coins;
void Start () {
PickUpCoins = GetComponent <AudioSource> ();
}
void OnTriggerEnter(Collider other) {
if (other.tag == "Coin")
{
Coins++;
UnityEngine.AudioSource.Play ();
Destroy(other.gameObject);
}
}
void OnGUI()
{
GUILayout.Label("Coins = " + Coins);
}
}