-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUI.cs
More file actions
49 lines (41 loc) · 1.07 KB
/
Copy pathUI.cs
File metadata and controls
49 lines (41 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class UI : MonoBehaviour {
//public Text timetext = Gameobject.Find("Text").getComponent<Text>();
public Text timetext;
public RawImage enveloppeuse;
public RawImage encaisseuse;
private int min;
private int seconds;
private int fraction;
private float starttime;
private float time;
public Text objectivetruck;
public int cheesestatus;
public Texture2D envelop;
// Use this for initialization
void Start () {
starttime = Time.time;
min = 2;
seconds = 0;
timetext.rectTransform.position.Set (32, 133, 0);
timetext.text = "Next Truck :" + min.ToString () + ":" + seconds.ToString ();
objectivetruck.text = cheesestatus.ToString () + "/10";
}
// Update is called once per frame
void Update () {
time += Time.deltaTime;
if (time >= 1) {
if(seconds != 0)
seconds -= 1;
else {
seconds = 59;
min -= 1;
}
time -= 1;
}
timetext.rectTransform.position.Set (32, 133, 0);
timetext.text = "Next Truck :" + min.ToString () + ":" + seconds.ToString ();
}
}