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(); }
private void RefreshResourceValue(GameObject resourceDisplay, ResourceVariable resourceVariable) { resourceDisplay.GetComponentInChildren <Text>().text = resourceVariable.value.ToString(); }