Added Swigs left gui text.
This commit is contained in:
parent
7c6613987e
commit
d4a6d0bb00
10 changed files with 153 additions and 128 deletions
27
Assets/Scripts/GameController.cs
Normal file
27
Assets/Scripts/GameController.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class GameController : MonoBehaviour {
|
||||
|
||||
public int swigs;
|
||||
public GUIText swigText;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
UpdateSwigText ();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
|
||||
public void TakeSwig() {
|
||||
swigs -= 1;
|
||||
UpdateSwigText();
|
||||
}
|
||||
|
||||
void UpdateSwigText() {
|
||||
swigText.text = "Swigs Left: " + swigs;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue