Skip to content
Snippets Groups Projects

Floating text prompts

Merged Karel Ševčík requested to merge floating_text_prompts into master
3 files
+ 45
4
Compare changes
  • Side-by-side
  • Inline
Files
3
  • e9688067
    Improve dialogue · e9688067
    Karel Ševčík authored
    + start dialogue using a key
    + advance lines using a key
    + disable player movement while in a dialogue
@@ -25,7 +25,13 @@ namespace Nudle.Scripts.Dialogue
DialogueCanvas.gameObject.SetActive(true);
}
public bool IsInDialogue() => currentDialogue is null;
internal void Update()
{
if (IsInDialogue() && Input.GetKeyDown(KeyCode.Space))
DisplayNextLine();
}
public bool IsInDialogue() => !(currentDialogue is null);
public void StartDialogue(Dialogue dialogue)
{
@@ -57,7 +63,7 @@ namespace Nudle.Scripts.Dialogue
public void DisplayChoices()
{
if (choiceButtons.Count > 0)
if (choiceButtons.Count > 0 || currentDialogue is null)
return;
if (currentDialogue.Choices is null || currentDialogue.Choices.Length == 0)
{
Loading