Update CollectCoins
This commit is contained in:
1 parent
d6fc1f2857
commit
aef8e2238b
51 files changed
+146
-11
No files matched your search
@@ -5,6 +5,9 @@ public class InventoryScript : MonoBehaviour {
|
||||
|
||||
// Use this for initialization
|
||||
public AudioClip pickupSound;
|
||||
public static int coinCount = 0;
|
||||
public GUIText coinCountText;
|
||||
public GUITexture coinPic;
|
||||
void Start () {
|
||||
|
||||
}
|
||||
@@ -17,5 +20,16 @@ public class InventoryScript : MonoBehaviour {
|
||||
void pickup()
|
||||
{
|
||||
AudioSource.PlayClipAtPoint(pickupSound, transform.position);
|
||||
coinCount++;
|
||||
}
|
||||
|
||||
void showCoinCount()
|
||||
{
|
||||
if (!coinPic.enabled)
|
||||
{
|
||||
coinPic.enabled = true;
|
||||
coinCountText.enabled = true;
|
||||
}
|
||||
coinCountText.text = coinCount.ToString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user