forked from GCSShatteredSpace/Week-2-Code-Reading
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayer.cs
35 lines (26 loc) · 801 Bytes
/
displayer.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
30
31
32
33
34
35
using UnityEngine;
using System.Collections;
//The display pannel
//Nothing really interesting
public class displayer : MonoBehaviour {
public GameObject statsCtrl;
public statsController dataBase;
public int current;
public TextMesh weaponName;
public TextMesh range;
public TextMesh damage;
public TextMesh special;
public shopButton button;
void Start () {
statsCtrl = GameObject.Find("gameData");
dataBase = statsCtrl.GetComponent<statsController> ();
}
public void display (int weapon) {
current = weapon;
weaponName.text = dataBase.weapons [weapon].weaponName;
range.text = dataBase.weapons [weapon].range.ToString();
damage.text = dataBase.weapons [weapon].damage.ToString();
special.text = dataBase.weapons [weapon].special;
button.weaponId = weapon;
}
}