I'm working on integrating the standard Quest Log UI into my project, and I'm having a bit of an issue regarding my control scheme- My game works on a keyboard only, and I want to automatically select the first quest in the main quest window. To do this I added a new script to to the Quest Titles Content game object here:
My script is:
Code: Select all
Button button;
public int startIndexNumber; // number to start list check from
// Start is called before the first frame update
private void OnEnable()
{
print(transform.GetChild(startIndexNumber));
if (transform.GetChild(startIndexNumber) != null)
{
button = transform.GetChild(startIndexNumber).GetComponent<Button>();
button.Select();
}
else
{
print("no button in the index number");
}
}
Do you know why this is the case?
Sorry if this is not a Dialogue System question- I think it might be more of a general Unity thing.