Browse Source

better score text on gameover screen

combinedRaceAndNameDropper
Josh 2 years ago
parent
commit
38cf596dca
  1. 12
      namedropper/Assets/GameOverScreen.cs
  2. 2
      namedropper/Assets/Scenes/GameOver.unity

12
namedropper/Assets/GameOverScreen.cs

@ -23,23 +23,21 @@ public class GameOverScreen : MonoBehaviour
ScoreStack blueScoreStack = GameObject.Find("/ScoreStackBlue").GetComponent<ScoreStack>(); ScoreStack blueScoreStack = GameObject.Find("/ScoreStackBlue").GetComponent<ScoreStack>();
ScoreStack redScoreStack = GameObject.Find("/ScoreStackRed").GetComponent<ScoreStack>(); ScoreStack redScoreStack = GameObject.Find("/ScoreStackRed").GetComponent<ScoreStack>();
_gameOverMessage.text = "<color=blue>" + blueScoreStack.Score + "</color><color=white> to </color><color=red>" + redScoreStack.Score + "</color>\n";
if (blueScoreStack.Score > redScoreStack.Score) if (blueScoreStack.Score > redScoreStack.Score)
{ {
_gameOverMessage.color = Color.blue; _gameOverMessage.text += "<color=blue>BLUE TEAM WINS!</color>";
_gameOverMessage.text = "BLUE TEAM WINS!\n" + blueScoreStack.Score + " to " + redScoreStack.Score;
} }
else if (redScoreStack.Score > blueScoreStack.Score) else if (redScoreStack.Score > blueScoreStack.Score)
{ {
_gameOverMessage.color = Color.red; _gameOverMessage.text += "<color=red>RED TEAM WINS!</color>";
_gameOverMessage.text = "RED TEAM WINS!\n" + redScoreStack.Score + " to " + blueScoreStack.Score;
} }
else else
{ {
_gameOverMessage.color = Color.white; _gameOverMessage.text += "<color=white>TIE!</color>";
_gameOverMessage.text = "TIE!\n" + redScoreStack.Score + " to " + blueScoreStack.Score;
} }
_gameOverMessage.text += "\n\nPress 'R' to replay"; _gameOverMessage.text += "<color=white>\n\nPress 'R' to replay</color>";
} }
} }

2
namedropper/Assets/Scenes/GameOver.unity

@ -229,7 +229,7 @@ MonoBehaviour:
m_HorizontalOverflow: 1 m_HorizontalOverflow: 1
m_VerticalOverflow: 1 m_VerticalOverflow: 1
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: GAME OVER m_Text: GAME OVER<color=red>sdf</color><color=blue>asdd</color>
--- !u!222 &1225785574 --- !u!222 &1225785574
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

Loading…
Cancel
Save