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

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nishant
Posts: 55
Joined: Mon Sep 21, 2015 3:16 pm
Location: Canada
Contact:

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

Post 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
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.
nishant
Posts: 55
Joined: Mon Sep 21, 2015 3:16 pm
Location: Canada
Contact:

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

Post by nishant »

That fixed it

Thanks :)
Post Reply