getcomponent button unity code example Example: Button.GetComponent Button yourButton = yourObject.GetComponent<Button>();