// kinda hacky crap aaa public IEnumerator toggleChoices(ChoiceLine choiceLine, ChoiceBubble choiceBubble) { while (!ready) { InputDirection dir = Controls.getInputDirectionDown(); if (dir == InputDirection.N) { choiceLine.PreviousOption(); choiceBubble.UpdateOption(choiceLine.GetOptionIndex()); } else if (dir == InputDirection.S) { choiceLine.NextOption(); choiceBubble.UpdateOption(choiceLine.GetOptionIndex()); } yield return(null); } }
// Kinda hacked together choice system internal void DisplayChoices(ChoiceLine line, Vector3 speakerPosition, DialogueBubbleType type = DialogueBubbleType.Thought) { ready = false; List <ChoiceLineContent> choices = line.dialogueChoices; int lineNumber = choices[0].lineNumber; ChoiceBubble choiceBubble = DialogueUIController.GenerateChoiceBubblePrefab(choices.Count(), type); for (int i = 0; i < choices.Count; i++) { ChoiceLineContent content = choices[i]; choiceBubble.choicePanels[i].SetChoicePanelContent(content); } dialogueBubbles.Add(choiceBubble); DeployBubble(choiceBubble, speakerPosition); choiceBubble.UpdateOption(line.GetOptionIndex()); StartCoroutine(toggleChoices(line, choiceBubble)); StartCoroutine(animateLogs(lineNumber)); }