Demo day booth
This commit is contained in:
committed by
Jelle De Geest
parent
5b4a3ec4e7
commit
fcd8acad1e
@@ -519,7 +519,7 @@ public class HangmanController : AbstractFeedback
|
||||
// The current sign was accepted, return to the game
|
||||
mode = 2;
|
||||
|
||||
if (corrects == currentWord.Length)
|
||||
if (corrects == currentWord.Replace(" ", "").Length)
|
||||
{
|
||||
// Victory, deactivate the model and show the scoreboard
|
||||
ActivateWin();
|
||||
@@ -625,7 +625,7 @@ public class HangmanController : AbstractFeedback
|
||||
/// <param name="word">The word to display</param>
|
||||
private void DisplayWord(string word)
|
||||
{
|
||||
for (int i = 0; i < word.Length; i++)
|
||||
foreach (Char c in word)
|
||||
{
|
||||
// Create instance of prefab
|
||||
GameObject instance = GameObject.Instantiate(letterPrefab, letterContainer);
|
||||
@@ -635,7 +635,7 @@ public class HangmanController : AbstractFeedback
|
||||
Image background = instance.GetComponent<Image>();
|
||||
background.color = Color.clear;
|
||||
TMP_Text txt = instance.GetComponentInChildren<TMP_Text>();
|
||||
txt.text = Char.ToString('_');
|
||||
txt.text = c == ' ' ? "" : Char.ToString('_');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user