void Update() { if (Input.GetKeyDown(KeyCode.Return) && canType) { string userInput = inputField.text; pastText.text = string.Concat(pastText.text, "<color=blue><b>You: </b></color>", "<color=blue>" + userInput + "</color>"); NewLine(); canType = false; step++; stepStarted = false; if (lookingForSecretResponse && userInput.Equals("F**k you")) { lookingForSecretResponse = false; StartCoroutine(WhiteRabbit4()); } } if (!stepStarted) { switch (step) { case 0: stepStarted = true; StartCoroutine(WhiteRabbit0()); break; case 1: stepStarted = true; StartCoroutine(WhiteRabbit1()); break; case 2: stepStarted = true; StartCoroutine(WhiteRabbit2()); break; case 3: stepStarted = true; StartCoroutine(WhiteRabbit3()); break; default: canType = true; CloseChat.Enable(); break; } } }
void Start() { if (step < 3) { CloseChat.Disable(); } else { CloseChat.Enable(); } ReFocus(); if (step < 0) { step++; } }
IEnumerator WhiteRabbit3() { canType = false; yield return(new WaitForSeconds(delay)); WhiteRabbitSpeak("Time is of the", true); WhiteRabbitSpeak("essence. I can't talk", false); WhiteRabbitSpeak("much. Bye bye!", false); yield return(new WaitForSeconds(delay)); WhiteRabbitSpeak("I can't think of how to", false); WhiteRabbitSpeak("thank you enough! You can try", false); WhiteRabbitSpeak("to trace me down, but you", false); yield return(new WaitForSeconds(delay)); WhiteRabbitSpeak("couldn't find me even if", false); WhiteRabbitSpeak("you tried!", false); canType = true; lookingForSecretResponse = true; CloseChat.Enable(); AliceDialogue.Advance(); }