Mercurial > hg > Members > kazuma > JungleforUnity
view Assets/Application/Scripts/ItemCanvas.cs @ 5:12f4f937da7f
Add BenchMark
author | Kazuma |
---|---|
date | Thu, 10 Nov 2016 04:21:19 +0900 |
parents | 2dd40b4412e4 |
children |
line wrap: on
line source
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 (); } }