public void DequeueDialogue() { if (dialogueInfo.Count == 0) { EndDialogue(); return; } //add in code that detects if we have no more dialogue and return DialogueBase.Info info = dialogueInfo.Dequeue(); dialogueName.text = info.myName; //Boşken paneli kapatıyoruz. if (dialogueName.text == "") { RemoveName(info); } else { namePanel.SetActive(true); } dialogueText.text = info.myText; dialoguePortrait.sprite = info.portrait; //charImage.sprite = info.charPortrait; //Karakterin resmini başka panele koyacaktım sonra kafam karıştı koymadım xd StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (dialogueInfo.Count == 0) { EndofDialogue(); return; } if (dialogueInfo.Count == 1) { if (npc.GetComponent <TestScript>().talked == false && npc.tag == "NPC") { g.GetComponent <GameManager>().count += 1; } istalked = true; npc.GetComponent <TestScript>().talked = istalked; float i = g.GetComponent <GameManager>().count; Debug.Log("pira na nakaulay kang player? = " + i); } DialogueBase.Info info = dialogueInfo.Dequeue(); dialogueName.text = info.myName; dialogueText.text = info.myText; StopAllCoroutines(); StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (isCurrentlyTyping == true) { CompleteText(); StopAllCoroutines(); isCurrentlyTyping = false; return; } if (dialogueInfo.Count == 0) { DeactiveCutscene(); return; } //add in code that detects if dialogue is no more DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.myText; dialogueName.text = info.character.myname; dialogueText.text = info.myText; dialoguePortrait.sprite = info.character.myPortrait; dialogueText.text = ""; StartCoroutine(TypeText(info)); DialogScroll.Invoke(); }
//Take out information public void DequeueDialogue() { //Debug.Log("Sentence number" + dialogueInfo.Count); if (isCurrentlyTyping == true) { CompleteText(); StopAllCoroutines(); //Theres only 1 coroutine lol isCurrentlyTyping = false; diamond.SetActive(true); scribbleAudio.SetActive(false); return; //Don't want to deque the dialogue } //Detects if we have no more dialogue and return if (dialogueInfo.Count == 0) { EndofDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.myText; dialogueName.text = info.myName; dialogueText.text = info.myText; dialoguePortrait.sprite = info.portrait; dialogueText.text = ""; //Clear text StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (isCurrentlyTyping == true) { CompleteText(); StopAllCoroutines(); isCurrentlyTyping = false; return; } if (dialogueInfo.Count == 0) { EndofDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.myText; //COMPLETI AQUI //dialogueName.text = info.myName; dialogueName.text = info.character.myName; dialogueText.text = info.myText; //dialoguePortrait.sprite = info.portrait; dialoguePortrait.sprite = info.character.myPortrait; dialogueText.text = ""; StartCoroutine(TypeText(info)); }
public void AddDialogue(DialogueBase db) { DialogueBase.Info firstDialogue = db.dialogueInfo[0]; if (triggered) { return; } StartCoroutine(Buffer()); //required so that the first text to appear types instead of just appearing triggered = true; dialogueInfo.Clear(); //makes sure the queue is empty before queuing new dialogue display.SetActive(true); //UI updates dialogueUI.SetActive(true); //UI updates ParseOptions(db); //done before enqueuing the dialogue so the options actually display foreach (DialogueBase.Info info in db.dialogueInfo) { dialogueInfo.Enqueue(info); } DequeueDialogue(); //start displaying the dialogue }
public void DequeueDialogue() { _audioSource.Play(); textDisplayAnimator.SetBool("isPaused", false); if (_isCurrentlyTyping) { CompleteText(); StopAllCoroutines(); _isCurrentlyTyping = false; return; } if (dialogueInfo.Count == 0) { EndDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); _audioManager.Play(info.character.voice); dialogueText.text = ""; StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (isCurrentlyTyping == true) { CompleteText(); StopAllCoroutines(); isCurrentlyTyping = false; return; } if (dialogueInfo.Count == 0) { EndofDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.textBase; dialogueName.text = info.characterBase.characterName; dialogueText.text = info.textBase; dialogueImage.sprite = info.imageBase; dialogueText.text = ""; StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (isCurrentlyTyping == true) { CompleteText(); StopAllCoroutines(); //cuidao q paramos todas isCurrentlyTyping = false; return; } if (dialogueInfo.Count == 0) { EndofDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); //recoge el primer dialogo completeText = info.myText; dialogueText.text = info.myText; dialogueName.text = info.character.myName; dialogueText.font = info.character.myFont; info.ChangeEmotion(); dialoguePortrait.sprite = info.character.MyPortrait; dialogueText.text = ""; StartCoroutine(TypeText(info)); }
IEnumerator TypeText(DialogueBase.Info info) { isCurrentlyTyping = true; foreach (char letter in info.myText.ToCharArray()) { dialogueText.text += letter; yield return(null); } }
private void DialogueSetter(DialogueBase.Info info) { dialogueName.text = info.character.name; completeText = info.sentence; dialogueText.text = info.sentence; dialogueText.font = info.character.font; info.ChangeEmotion(); dialoguePortrait.sprite = info.character.Portrait; }
//pour enlever les infos une par une dans l'ordre (FIFO) public void DequeueDialogue() { if (isCurrentlyTyping == true) { CompleteText(); StopAllCoroutines(); isCurrentlyTyping = false; //tout ce qu'il y a après le return n'est pas utilisé return; } //pour supprimer la boite de dialogue lorsqu'il n'y a plus de lignes à insérer dedans if (dialogueInfo.Count == 0) { EndofDialogue(); //tout ce qu'il y a après le return n'est pas utilisé return; } DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.myText; //nameHolder.position = characterPortraits[GetCurrentCharacterIndex(info)].gameObject.transform.position - new Vector3(1000,10); //dialogueName.text = info.myName; dialogueName.text = info.character.myName; if (dialogueName.text == "INSPECTEUR") { nameHolder.localPosition = new Vector2(-190, nameHolder.localPosition.y); } else { nameHolder.localPosition = new Vector2(190, nameHolder.localPosition.y); } dialogueText.text = info.myText; //dialoguePortrait.sprite = info.myPortrait; //change Emotion et ensuite appelle myPortrait info.ChangeEmotion(); //assombrit personnages DarkenOtherPortraits(info); //dialoguePortrait.sprite = info.character.MyPortrait; characterPortraits[GetCurrentCharacterIndex(info)].sprite = info.character.MyPortrait; //Retire tous les textes avant d'en insérer un nouveau dialogueText.text = ""; //Type Writing Effect StartCoroutine(TypeText(info)); }
IEnumerator TypeText(DialogueBase.Info info) { dialogueText.text = ""; foreach (char c in info.myText.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; yield return(null); } }
private IEnumerator TypeText(DialogueBase.Info a_info) { isCurrentlyTyping = true; foreach (char a_char in a_info.text.ToCharArray()) { yield return(new WaitForSeconds(dialogueDelay)); dialogueText.text += a_char; } isCurrentlyTyping = false; }
//Coroutine to type text so it appears on screen with animation IEnumerator TypeText(DialogueBase.Info info) { currentlyTyping = true; foreach (char c in info.myText.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; } currentlyTyping = false; }
IEnumerator TypeText(DialogueBase.Info info) { isCurrentlyTyping = true; foreach (char c in info.myText.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; //AudioManager.instance.PlayClip(info.myVoice); //play every letter FMODUnity.RuntimeManager.PlayOneShot("event:/Overworld/SFX/Text Type"); } isCurrentlyTyping = false; }
IEnumerator TypeText(DialogueBase.Info newInfo) { WaitForSeconds delay = new WaitForSeconds(0.001f); dialogueText.text = ""; foreach (char c in newInfo.myText.ToCharArray()) { yield return(delay); dialogueText.text += c; yield return(null); } }
//Coroutine to type the text instead of having it just appear //Needs to be a coroutine otherwise the letters get jumbled IEnumerator TypeText(DialogueBase.Info info) { typing = true; dialogueText.text = ""; foreach (char c in info.words.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; yield return(null); } typing = false; }
IEnumerator TypeText(DialogueBase.Info info) { isCurrentlyTyping = true; foreach (char c in info.myText.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; //AudioManager.instance.PlayClip(info.character.myVoice); // COLOQUEI ISSO } isCurrentlyTyping = false; }
private int GetCurrentCharacterIndex(DialogueBase.Info info) { //loop parmi les 2 persos for (int i = 0; i < currentDialogue.characters.Length; i++) { //vérifie si le perso est bien celui de la liste if (info.character == currentDialogue.characters[i]) { return(i); } } Debug.Log("Error ! Character is not in the list"); return(0); }
/// <summary> /// Update the next dialogue line. /// </summary> public void DequeueDialogue() { if (isCurrentlyTyping) { if (isBuffering) { return; } CompleteText(); StopAllCoroutines(); isCurrentlyTyping = false; return; } // Set the current Dialogue Line. dialogueLineIndex++; // Check for events to be fired. if (hasDialogueEvents) { DialogueEvent dialogueEvent = dialogue as DialogueEvent; foreach (DialogueEvent.Event a_event in dialogueEvent.dialogueEvents) { if (a_event.eventLine == dialogueLineIndex) { a_event.myEvent?.Invoke(); } } } // Close dialogue box when reaching the end. if (dialogueInfo.Count == 0) { if (isDialogueOption) { OptionsLogic(); } else { CloseDialogue(); } return; } DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.text; dialogueText.text = ""; StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (typing) { if (buffer) { return; } CompleteText(); StopAllCoroutines(); typing = false; return; } if (dialogueInfo.Count == 0) { EndDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.words; dialogueText.text = info.words; dialoguePortrait.sprite = info.portrait; if (info.charName == "") { dialogueName.text = ""; nameTag.SetActive(false); } else { dialogueName.text = info.charName; nameTag.SetActive(true); } if (info.nextDialogue != null) { next = info.nextDialogue; } else { next = null; } dialogueText.text = ""; StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (dialogueInfo.Count == 0) { EndofDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); dialogueName.text = info.myName; dialogueText.text = info.myText; dialoguePortrait.sprite = info.portrait; StartCoroutine(TypeText(info)); }
public void DequeueDialogue() { if (DialogueInfo.Count == 0) { EndOfDialogue(); return; } DialogueBase.Info info = DialogueInfo.Dequeue(); DialogueName.text = info.MyName; DialogueText.text = info.MyText; DialoguePortrait.sprite = info.Portrait; //StartCoroutine(TypeText(info)); }
// Coroutines IEnumerator TypeText(DialogueBase.Info info) { _isCurrentlyTyping = true; foreach (char c in info.sentence.ToCharArray()) { yield return(new WaitForSeconds(textSlowness)); dialogueText.text += c; if (CheckPunctuation(c)) { yield return(new WaitForSeconds(0.25f)); } } textDisplayAnimator.SetBool("isPaused", true); _isCurrentlyTyping = false; }
IEnumerator TypeText(DialogueBase.Info info) { isCurrentlyTyping = true; diamond.SetActive(false); scribbleAudio.SetActive(true); //Text is set to empty //dialogueText.text = ""; //Every letter adds in one by one foreach (char c in info.myText.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; } isCurrentlyTyping = false; diamond.SetActive(true); scribbleAudio.SetActive(false); }
IEnumerator TypeText(DialogueBase.Info info) { isCurrentlyTyping = true; foreach (char c in info.myText.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; AudioManager.instance.PlayClip(info.character.myVoice); if (CheckPunctuation(c)) { yield return(new WaitForSeconds(0.25f)); } } isCurrentlyTyping = false; }
public void DequeueDialogue() { if (isCurrentlyTyping == true) { if (buffer == true) { return; } CompleteText(); StopAllCoroutines(); isCurrentlyTyping = false; return; } if (dialogueInfo.Count == 0) { EndDialogue(); return; } DialogueBase.Info info = dialogueInfo.Dequeue(); completeText = info.myText; //dialogueName.text = info.characterName; dialogueText.text = info.myText; //dialogueText.font = info.myFont; //dialoguePortrait.sprite = info.portrait; //if(info.portraitToggle == true) //{ // dialoguePortrait.gameObject.SetActive(true); //} //else //{ // dialoguePortrait.gameObject.SetActive(false); //} dialogueText.text = ""; //AudioManager.instance.PlayClip(info.myVoice); //one time play StartCoroutine(TypeText(info)); }
//Coroutine pour le Type Writer Effect IEnumerator TypeText(DialogueBase.Info info) { isCurrentlyTyping = true; //dialogueText.text = ""; //ajoute les lettres une par une foreach (char c in info.myText.ToCharArray()) { yield return(new WaitForSeconds(delayType)); dialogueText.text += c; //yield return null; AudioManager.instance.PlayClip(info.character.myVoice); if (CheckPunctuation(c)) { yield return(new WaitForSeconds(delayPunctuation)); } } isCurrentlyTyping = false; }
IEnumerator TypeText(DialogueBase.Info info) { isCurrentlyTyping = true; var txt = ParseNames(info.myText); completeText = txt; foreach (char c in txt.ToCharArray()) { yield return(new WaitForSeconds(delay)); dialogueText.text += c; if (info.character != null) { if (info.character.myVoice != null) { AudioManager.instance.PlayClip(info.character.myVoice); } } } isCurrentlyTyping = false; }