public void Initialize() { health = transform.FindChild("HealthBar").gameObject.GetComponent <FillBar>(); unitName = transform.FindChild("Top Panel").FindChild("Unit Name").GetComponent <Text>(); health.Initialize(); mainResource = transform.FindChild("ResourceBar").gameObject.GetComponent <FillBar>(); mainResource.Initialize(); }