+using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public Text dialogueText;
public string[] sentences;
-
+
[HideInInspector]
public int index;
public float typingSpeed;
+ public bool skip;
+
void Start()
{
dialogueBox.SetActive(false);
{
continueButton.SetActive(true);
}
+
+ if (dialogueText.text != sentences[index])
+ {
+ if (Input.GetKeyDown(KeyCode.Return) || Input.GetMouseButtonDown(0))
+ {
+ skip = true;
+ }
+ else
+ {
+ skip = false;
+ }
+ }
}
public IEnumerator Type()
}
}
+ public void Skip()
+ {
+ dialogueText.text = sentences[index];
+ }
+
public void NextSentence()
{
FindObjectOfType<AudioManager>().Play("click");
continueButton.SetActive(false);
+ skip= false;
if (index < sentences.Length - 1)
{
mouse.GetComponent<MouseController>().enabled = true;
}
}
-}
\ No newline at end of file
+}