Quest Close Button
Quest Close Button
i Tony,
Do you have a helper class for calling the close quest button.
Im using a controller but i need to so somthing when i close it.
i.e EventSystem.current.SetSelectedGameObject(buttons[0].gameObject);
Im not sure how to do this as im not modifing your script.
Do you have a helper class for calling the close quest button.
Im using a controller but i need to so somthing when i close it.
i.e EventSystem.current.SetSelectedGameObject(buttons[0].gameObject);
Im not sure how to do this as im not modifing your script.
Re: Quest Close Button
Hi,
You can write a simple script that calls:
Or add a QuestLogWindowHotkey component to your button and connect the OnClick() event to its ToggleQuestLogWindow() method. This method will close the quest log window if it's open, or open it if it's closed.
You can write a simple script that calls:
Code: Select all
PixelCrushers.GameObjectUtility.FindFirstObjectByType<PixelCrushers.DialogueSystem.QuestLogWindow>().Close();
Re: Quest Close Button
Thanks,
Unless im not understanding correctly i need a listen event to know when that button has been closed so i can do somthing on another script.
Unless im not understanding correctly i need a listen event to know when that button has been closed so i can do somthing on another script.
Re: Quest Close Button
I might close the button with a mouse click of input.getbutton.
Re: Quest Close Button
If you need to know when the quest log window has closed, you can hook into the OnClose() UnityEvent.
Re: Quest Close Button
Code: Select all
public QuestLogWindow questLogWindow;
void OnDestroy()
{
if (questLogWindow != null)
{
questLogWindow.OnClose.RemoveListener(OnQuestLogClosed);
}
}
private void Start()
{
if (questLogWindow != null)
{
questLogWindow.OnClose.AddListener(OnQuestLogClosed);
}
}
Re: Quest Close Button
Hi,
If you're connecting it in C# code, it's StandardUIQuestLogWindow.onClose with a lowercase 'o':
It appears in the inspector as OnClose().
If you're connecting it in C# code, it's StandardUIQuestLogWindow.onClose with a lowercase 'o':
Code: Select all
questLogWindow.onClose.AddListener(OnQuestLogClosed);
...
questLogWindow.onClose.RemoveListener(OnQuestLogClosed);