public Sprite GetImage(Player.Death val) { if (dico.ContainsKey(val)) { return(dico[val]); } else { return(none); } }
public void StartDialogue(string key, DialogueType dialogueType, Player.Death deathType = Player.Death.barbecue) { player.isTalking = true; textList = TextesDictionary.GetTexte(key); if (textList.Count == 0) { Debug.Log("Le dialogue n'a pas de composants"); } things.SetActive(true); StartCoroutine(PrintText(dialogueType, deathType)); }
IEnumerator PrintText(DialogueType dialogueType, Player.Death deathType) { for (int i = 0; i < textList.Count; i++) { actualText = textList[i].text; image.sprite = dialogueImages.GetImage(textList[i].image); skip = false; text.text = ""; yield return(new WaitForSeconds(WAIT_AT_START)); foreach (char c in actualText) { text.text += c; if (!skip) { yield return(new WaitForSeconds(SHORT_DELTA_TIME)); if (c == '.' || c == '!' || c == '?' || c == ';' || c == '\n') { yield return(new WaitForSeconds(LONG_DELTA_TIME)); } else if (c == ',') { yield return(new WaitForSeconds(DELTA_TIME)); } } } skip = true; next = false; while (!next) { yield return(new WaitForSeconds(SHORT_DELTA_TIME)); } } things.SetActive(false); switch (dialogueType) { case DialogueType.DIE: death.StartDeath(deathType); break; case DialogueType.BOSS: end.GameOver(); break; case DialogueType.NOTHING: default: player.isTalking = false; break; } }
public void StartDeath(Player.Death deathType) { if (!deathNote.ContainsKey(deathType)) { Debug.LogError("Type de mort inconnue"); return; } deathExplanation.text = ""; deathPowerExplanation.text = ""; deathPowerTitle.SetActive(false); image.gameObject.SetActive(false); nextText.SetActive(false); things.SetActive(true); StartCoroutine(PrintText(deathType)); }
IEnumerator PrintText(Player.Death deathType) { DeathPatern actualPatern = deathNote[deathType]; player.ResetPosition(); yield return(new WaitForSeconds(WAIT_AT_START)); foreach (char c in actualPatern.deathDescription) { deathExplanation.text += c; yield return(new WaitForSeconds(SHORT_DELTA_TIME)); if (c == '.' || c == '!' || c == '?' || c == ';' || c == '\n') { yield return(new WaitForSeconds(LONG_DELTA_TIME)); } else if (c == ',') { yield return(new WaitForSeconds(DELTA_TIME)); } } deathPowerTitle.SetActive(true); image.sprite = powerIcone.GetImage(deathType); image.gameObject.SetActive(true); deathPowerExplanation.text = actualPatern.deathPowerDescription; nextText.SetActive(true); next = false; while (!next) { yield return(new WaitForSeconds(SHORT_DELTA_TIME)); } things.SetActive(false); player.isTalking = false; }
private void Awake() => _death = GetComponent <Logic.Death>();
public DeathScreenPatern() { deathType = Player.Death.barbecue; deathDescription = new DeathPatern(); }
public DeathScreenPatern(Player.Death deathTypeIn, DeathPatern deathDescriptionIn) { deathType = deathTypeIn; deathDescription = deathDescriptionIn; }