-
Notifications
You must be signed in to change notification settings - Fork 0
/
HUDUpdater.cs
29 lines (26 loc) · 908 Bytes
/
HUDUpdater.cs
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
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System;
public class HUDUpdater : MonoBehaviour {
PlayerManager pm;
ConfigManager cm;
public Slider pufferSlider;
public Slider breathSlider;
public Text ScoreText;
public Text TimeText;
// Use this for initialization
void Start () {
cm = GameObject.Find ("Configuration").GetComponent <ConfigManager>();// GetComponent<ConfigManager> ();
pm = GameObject.Find("Player").GetComponent<PlayerManager>();
pufferSlider.maxValue = (float)Double.Parse(cm.Load ("MaxPufferCharge"));;
breathSlider.maxValue = (float)Double.Parse(cm.Load ("MaxBreath"));
}
// Update is called once per frame
void Update () {
ScoreText.text = "Score: " + pm.getscore();
TimeText.text = "Time: " + pm.gettime();
breathSlider.value = pm.getBreath();
pufferSlider.value = pm.getPufferCharge();
}
}