/// <summary> /// Update the choices popup /// </summary> private void updateChoicesPopup() { LogicStep currLogicStep = logicSteps[currStep]; string[] choices = currLogicStep.GetChoices(); ChoicePopup.SetActive(true); for (int i = 0; i < Choices.Length; i++) { Choices[i].gameObject.SetActive(true); if (i >= choices.Length) { // if there are less choices than there are buttons for choices Choices[i].gameObject.SetActive(false); } else { Choices[i].text = choices[i]; } } EventSystem.current.SetSelectedGameObject(null); EventSystem.current.SetSelectedGameObject(Choices[0].gameObject); }
/// <summary> /// Determine if the step is selecting multiple choice /// </summary> /// <param name="logicStep">Step of the Logic System</param> /// <returns>True if is selecting multiple choice, false otherwise</returns> public static bool IsMultipleChoice(LogicStep logicStep) { return(logicStep.GetChoices().Length > 0); }