Page 1 of 1
Quest WIndow Scene Events
Posted: Thu Nov 19, 2020 3:37 pm
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()?
Re: Quest WIndow Scene Events
Posted: Thu Nov 19, 2020 3:52 pm
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); });