Mercurial > hg > Members > kazuma > JungleforUnity
diff Assets/Application/Scripts/ItemCanvas.cs @ 3:2dd40b4412e4
Create game base.
author | Kazuma |
---|---|
date | Mon, 07 Nov 2016 18:42:01 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Assets/Application/Scripts/ItemCanvas.cs Mon Nov 07 18:42:01 2016 +0900 @@ -0,0 +1,20 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; + +public class ItemCanvas : MonoBehaviour { + public GameObject ItemImage; + private Text[] itemText = new Text[3]; + + public void Start () { + for (int i = 0; i < 3; i++) { + itemText [i] = this.transform.GetChild (i).gameObject.GetComponentInChildren<Text>(); + } + Player.Instance.SetCallback (ChangeCount); + } + public void ChangeCount (int sand, int wood, int glass) { + itemText [0].text = sand.ToString (); + itemText [1].text = wood.ToString (); + itemText [2].text = glass.ToString (); + } +}