Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Cash : MonoBehaviour
- {
- public float cash;
- void Update()
- {
- //Checks if player got any score added
- if (TileManager.gotScore == true)
- {
- //add 10 of cash
- cash += 10;
- //Show on the log the points won, the cash won and the new score and new cash
- Debug.Log("You won 1 point and 10 cash.\nYou now have " + TileManager.score + " points, and " + cash + " of cash.");
- //returns the Bool false to restart operation
- TileManager.gotScore = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement