Quest WIndow Scene Events

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Jon
Posts: 5
Joined: Tue Nov 03, 2020 7:56 am

Quest WIndow Scene Events

Post by Jon »

Me again! I am looking to hide some aspects of the UI when the Quest Log Window opens. I didn't see anything already in the script to add a scene event to accomplish this. So I looked at the Quest Log Window script, do I need to override the OpenWindow() and CloseWindow()?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest WIndow Scene Events

Post by Tony Li »

Hi,

The quest log window has OnOpen() and OnClose() UnityEvents. You can hook them up in the inspector or in code. Code example:

Code: Select all

var questLogWindow = GetComponent<QuestLogWindow>();
questLogWindow.onOpen.AddListener(() => { myUIElement.SetActive(false); });
questLogWindow.onClose.AddListener(() => { myUIElement.SetActive(true); });
Post Reply