From c66a0045cdcde9eed694f9091b6377de24cb96a1 Mon Sep 17 00:00:00 2001 From: Mateus Pires Date: Mon, 16 Nov 2015 16:38:53 -0200 Subject: [PATCH] Tratamento de pontuaçcao. --- Assets/Scripts/GenericPlayerManager.cs | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/GenericPlayerManager.cs b/Assets/Scripts/GenericPlayerManager.cs index 93c1167..4e2128e 100644 --- a/Assets/Scripts/GenericPlayerManager.cs +++ b/Assets/Scripts/GenericPlayerManager.cs @@ -390,8 +390,37 @@ public abstract class GenericPlayerManager : MonoBehaviour { spelled = false; } - playAnimation(TYPE_WORD, aniName); + bool isPunctuation = false; lastAnimationSubtitle = aniName; + + if (aniName[0] == '[') + { + if (aniName.Equals("[PONTO]")) + { + isPunctuation = true; + lastAnimationSubtitle = "."; + } + + else if (aniName.Equals("[INTERROGACAO]")) + { + isPunctuation = true; + lastAnimationSubtitle = "?"; + } + + else if (aniName.Equals("[EXCLAMACAO]")) + { + isPunctuation = true; + lastAnimationSubtitle = "!"; + } + } + + if (isPunctuation) + playAnimation(TYPE_WORD, aniName, lastAnimationSubtitle); + else + playAnimation(TYPE_WORD, aniName); + + /*playAnimation(TYPE_WORD, aniName); + lastAnimationSubtitle = aniName;*/ } // Soletra palavra else @@ -401,13 +430,20 @@ public abstract class GenericPlayerManager : MonoBehaviour { if ( ! nonexistent) nonexistentAssetBundles.Add(aniName); - // Se já houve o soletramento de alguma palavra, reproduz animação default - if (spelled) - playAnimation(TYPE_NONE, DEFAULT_ANIMATION, lastAnimationSubtitle, 1.6F); + if (aniName[0] == '[' && (aniName.Equals("[PONTO]") || aniName.Equals("[INTERROGACAO]") || aniName.Equals("[EXCLAMACAO]"))) + { + playAnimation(TYPE_NONE, DEFAULT_ANIMATION, "", 1.6F); + } else - spelled = true; + { + // Se já houve o soletramento de alguma palavra, reproduz animação default + if (spelled) + playAnimation(TYPE_NONE, DEFAULT_ANIMATION, lastAnimationSubtitle, 1.6F); + else + spelled = true; - lastAnimationSubtitle = spellWord(aniName); + lastAnimationSubtitle = spellWord(aniName); + } } } -- libgit2 0.21.2