- Home /
Question by
NoiseyAgent · Dec 13, 2016 at 03:15 AM ·
unity 5buttoninspectorbutton trigger events
Button OnClick not displaying in inspector
When I assign the OnClick from Start(), OnEnable() or Reset(). it does not show in the inspector. The event fires just fine but is not showing in inspector. The OnClick for the button still says emtpy after starting the game. In the code below the OKButton is assigned from another script. Its definitely not coming back null.
public Button OKButton;
// Use this for initialization
void Start()
{
if (OKButton != null)
{
OKButton.onClick.AddListener(delegate { OKButton_OnClick(); });
}
}
void OKButton_OnClick()
{
Debug.Log("Test");
}
Comment
Answer by getyour411 · Dec 13, 2016 at 03:16 AM
That is the expected behavior - listeners added via runtime don't show up in the Inspector but they work just fine.
Is there anyway to get it to show? Will the inspector show custom Events/listeners?
It would be nice if I could see it when working in the inspector but not too big of a deal