private void UpdateUI() { MemoryLayer layer = selectedObject.transform.root.GetComponent <MemoryLayer>(); GameObject.FindGameObjectWithTag("SelectedLayerText").GetComponent <Text>().text = layer.name; layer.UpdateSizeLabel(); layer.SetSizeSliderPosition(); }