Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class InventorySystem : MonoBehaviour {
  7.  
  8.     public int currency;
  9.     public Text currencyField;
  10.     // Use this for initialization
  11.     void Start ()
  12.     {
  13.        
  14.         currency = 0;
  15.     }
  16.    
  17.     // Update is called once per frame
  18.     void Update ()
  19.     {
  20.         currencyField.text = currency.ToString ();
  21.  
  22.     }
  23.  
  24.     public void AddMoney()
  25.     {
  26.         currency = currency + 100;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement