Exemplo n.º 1
0
        private void AddResourceToPanel(ResourceVariable resourceVariable)
        {
            GameObject resourceObject = GameObject.Instantiate(resourceDisplayPrefab, this.transform);

            resourceObject.name = resourceVariable.name;
            resourceObject.GetComponentInChildren <Image>().sprite = resourceVariable.sprite;
            resourceObject.GetComponentInChildren <Text>().text    = resourceVariable.value.ToString();
        }
Exemplo n.º 2
0
 private void RefreshResourceValue(GameObject resourceDisplay, ResourceVariable resourceVariable)
 {
     resourceDisplay.GetComponentInChildren <Text>().text = resourceVariable.value.ToString();
 }