예제 #1
0
    internal static ChoiceBubble GenerateChoiceBubblePrefab(int choiceCount, DialogueBubbleType type = DialogueBubbleType.Thought)
    {
        ChoiceBubble choiceBubble = Instantiate(staticSpeechChoicePrefab).GetComponent <ChoiceBubble>();

        choiceBubble.SetDialogueBubbleType(type);
        choiceBubble.Instantiate(choiceCount);
        choiceBubble.gameObject.SetActive(false);
        return(choiceBubble);
    }
예제 #2
0
 // 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);
     }
 }
예제 #3
0
    // 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));
    }