public IEnumerator coroutineSayAll() { m_state = TutoState.Talking; foreach (string message in textsToSay) { textField.setMessage(message); textField.resetText(); textField.startTyping(); while (!textField.isComplete()) { yield return(null); } // wait before displaying next message m_state = TutoState.Waiting; //yield return new WaitForSeconds(0.1f); while (m_state == TutoState.Waiting) { yield return(null); } } m_state = TutoState.Finish; if (dialogueEndCallback != null) { dialogueEndCallback(); } else { getOut(); } }
public IEnumerator coroutineSayAll() { m_state = TutoState.Talking; foreach(string message in textsToSay) { textField.setMessage(message); textField.resetText(); textField.startTyping(); while(!textField.isComplete()) yield return null; // wait before displaying next message m_state = TutoState.Waiting; //yield return new WaitForSeconds(0.1f); while(m_state == TutoState.Waiting) yield return null; } m_state = TutoState.Finish; if(dialogueEndCallback != null) dialogueEndCallback(); else getOut(); }
private IEnumerator waitForOut() { yield return(new WaitForSeconds(1.7f)); m_state = TutoState.Hidden; if (outCallback != null) { outCallback(); } }
private IEnumerator waitForReady() { yield return(new WaitForSeconds(1.7f)); m_state = TutoState.Ready; if (readyCallback != null) { readyCallback(); } }
// Update is called once per frame void Update() { if ((m_state == TutoState.Talking || m_state == TutoState.Waiting) && Input.GetButtonDown("Fire1")) { if (m_state == TutoState.Talking) { // instant display of the rest of the current message (coroutine handle that!) textField.instantDisplay(); } else { m_state = TutoState.Talking; } } }
private void setTutoState(TutoState state) { this.tutoState = state; }
private IEnumerator waitForReady() { yield return new WaitForSeconds(1.7f); m_state = TutoState.Ready; if(readyCallback != null) readyCallback(); }
private IEnumerator waitForOut() { yield return new WaitForSeconds(1.7f); m_state = TutoState.Hidden; if(outCallback != null) outCallback(); }
// Update is called once per frame void Update() { if( (m_state == TutoState.Talking || m_state == TutoState.Waiting) && Input.GetButtonDown("Fire1")) { if(m_state == TutoState.Talking) { // instant display of the rest of the current message (coroutine handle that!) textField.instantDisplay(); } else { m_state = TutoState.Talking; } } }
public void TutoPass() { if (counter >= 6) { MenuController.blockPause = false; SceneManager.LoadScene(1); } m_tuto = (TutoState)counter; text[0].SetActive(false); switch (m_tuto) { case TutoState.pointLife: for (int i = 0; i < arrows.Count; i++) { arrows[i].SetActive(false); text[i].SetActive(false); arrows[0].SetActive(true); text[1].SetActive(true); } break; case TutoState.pointFood: for (int i = 0; i < arrows.Count; i++) { arrows[i].SetActive(false); text[i].SetActive(false); arrows[1].SetActive(true); text[2].SetActive(true); } break; case TutoState.pointPause: for (int i = 0; i < arrows.Count; i++) { arrows[i].SetActive(false); text[i].SetActive(false); arrows[2].SetActive(true); text[3].SetActive(true); } break; case TutoState.pointJoystick: for (int i = 0; i < arrows.Count; i++) { arrows[i].SetActive(false); text[i].SetActive(false); arrows[3].SetActive(true); text[4].SetActive(true); } break; case TutoState.pointShotB: for (int i = 0; i < arrows.Count; i++) { arrows[i].SetActive(false); text[i].SetActive(false); arrows[4].SetActive(true); text[5].SetActive(true); } break; case TutoState.pointAbilityB: for (int i = 0; i < arrows.Count; i++) { arrows[i].SetActive(false); text[i].SetActive(false); arrows[5].SetActive(true); text[6].SetActive(true); } break; default: break; } counter++; }