private void Awake() { messageT = transform.Find("message").Find("messageT").GetComponent <Text>(); talking = transform.Find("Voice").GetComponent <AudioSource>(); transform.Find("message").GetComponent <Button_UI>().ClickFunc = () => { if (tws != null && tws.IsActive()) { tws.WriteAndDestroy(); } else { if (i <= 12) { message = messageArray[i]; StartTalkingSound(); tws = TextWriting.AddWritingStatic(messageT, message, .05f, true, true, StopTalkingSound); i += 1; } else { float seconds = .4f; StartCoroutine(_wait(seconds)); //test(); } } }; }
IEnumerator _wait(float time) { message = messageArray[i]; StartTalkingSound(); tws = TextWriting.AddWritingStatic(messageT, message, .05f, true, true, StopTalkingSound); yield return(new WaitForSeconds(time)); SceneManager.LoadScene("MainMenu"); }
public void writeAllAndDestroy() { uiText.text = toBeWritten; characterIndex = toBeWritten.Length; if (onComplete != null) { onComplete(); } TextWriting.RemoveWriter_Static(uiText); }
public void WriteAndDestroy() { uiText.text = textWrite; charidx = textWrite.Length; if (onComplete != null) { onComplete(); } TextWriting.RemoveWriter_Static(uiText); }
// Start is called before the first frame update void Awake() { buttonui.ClickFunc = () => { if (textWriterSingle != null && textWriterSingle.isActive()) { textWriterSingle.writeAllAndDestroy(); } else { string[] messageArray = new string[] { "The vague mumbling of voices reach their ears, some loud," + "some soft. But utterly indiscernable", "Screaming flashes of red. Followed by seemingly unending darkness", "Dull thuds rocked their body, jolting them about", "Sights. Souunds. Feelings. All melded into a mindless swirl. Unidentifiable among" + " the mist of senses", }; string message = messageArray[messageNum]; textWriterSingle = TextWriting.TextWriter_Static(messageText, message, 0.05f, true, true, NextLine); } }; }
public void Awake() { instance = this; textWriterSingleList = new List <TextWriterSingle>(); }
private void Awake() { inst = this; twsList = new List <TextWritingSingle>(); }
private void Start() { StartTalkingSound(); tws = TextWriting.AddWritingStatic(messageT, "Hello Folks! \n" + "Just click somewhere inside the bubble to continue …", .05f, true, true, StopTalkingSound); }