Erwin23p

Cash.cs

Sep 27th, 2016
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2.  
  3. public class Cash : MonoBehaviour
  4. {
  5.     public float cash;
  6.  
  7.     void Update()
  8.     {
  9.         //Checks if player got any score added
  10.         if (TileManager.gotScore == true)
  11.         {
  12.             //add 10 of cash
  13.             cash += 10;
  14.  
  15.             //Show on the log the points won, the cash won and the new score and new cash
  16.             Debug.Log("You won 1 point and 10 cash.\nYou now have " + TileManager.score + " points, and " + cash + " of cash.");
  17.  
  18.             //returns the Bool false to restart operation
  19.             TileManager.gotScore = false;
  20.         }
  21.     }
  22. }
RAW Paste Data