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