public void StartDiagChoice(DialogueChoice dialogue_choice, DialogueActor player_trigger) { if (IsRunning()) return; if (dialogue_choice == current_choice) return; //Debug.Log("Trigger choice " + gameObject.name); current_choice = dialogue_choice; choice_player = player_trigger; DialogueChoicePanel.Get().Show(dialogue_choice, player_trigger); }
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; }
void Start() { choices_list = DialogueChoice.GetAllOf(this); events_list = DialogueEvent.GetAllOf(this); if (portrait_zoomed_prefab) { GameObject portrait = Instantiate(portrait_zoomed_prefab); portrait_instance = portrait.GetComponent <CinematicActorPortrait>(); portrait.SetActive(false); } if (NarrativeManager.Get() != null) { GameObject tbtn = Instantiate(NarrativeManager.Get().talk_button_prefab, transform.position, Quaternion.identity); tbtn.GetComponent <ButtonDisplayTalk>().actor = this; } }
public void AfterSelectChoice() { current_choices = null; Hide(); }