Page 1 of 1

Are there any methods that are called before and after buttons / input field are displayed ?

Posted: Mon Nov 16, 2015 2:25 pm
by nishant
Hi ,
My team is doing an optimization pass on UI and its decided to enable raycasters only when any interactable UI object is displayed. For buttons I am aware that ShowResponses get called when buttons are displayed but is there any other function that gets called once the responses go away ?? Also are there any functions that gets called when input field is displayed and after it goes away ? Currently I am handling this in Dialogue System by using SendMessage in every conversation . It would help if I handle it once in code instead of using SendMessage.

Thanks.
Nishant

Re: Are there any methods that are called before and after buttons / input field are displayed ?

Posted: Mon Nov 16, 2015 4:12 pm
by Tony Li
Hi Nishant,

When the response menu or input field are displayed, the Dialogue System activates their GameObjects. When they're done, the Dialogue System deactivates them. You could add a script to the response panel and the input field panel that has OnEnable and OnDisable methods.

Re: Are there any methods that are called before and after buttons / input field are displayed ?

Posted: Mon Nov 23, 2015 2:06 pm
by nishant
That fixed it

Thanks :)