public void Show(DialogueChoice cinematic_choice, DialogueActor player_trigger) { if (cinematic_choice == null) { return; } current_choices = cinematic_choice; current_player = player_trigger; DialogueChoiceItem[] choices = cinematic_choice.GetChoices(); int button_map_index = 0; for (int i = 0; i < 4; i++) { button_map[i] = -1; if (choices.Length >= (i + 1) && choices[i].AreConditionsMet()) { button_map[button_map_index] = i; button_map_index++; } } choice_text1.gameObject.SetActive(button_map[0] >= 0); choice_text2.gameObject.SetActive(button_map[1] >= 0); choice_text3.gameObject.SetActive(button_map[2] >= 0); choice_text4.gameObject.SetActive(button_map[3] >= 0); if (button_map[0] >= 0) { choice_text1.text = choices[button_map[0]].text; } if (button_map[1] >= 0) { choice_text2.text = choices[button_map[1]].text; } if (button_map[2] >= 0) { choice_text3.text = choices[button_map[2]].text; } if (button_map[3] >= 0) { choice_text4.text = choices[button_map[3]].text; } Show(); timer = 0f; }
public void SelectChoice(int choice) { if (current_choices == null) { return; } if (choice < 0) { return; } if (choice < current_choices.GetChoices().Length) { NarrativeManager.Get().DoDiagChoice(choice); } }