// Use this for initialization void Start() { PlayerLeftScore = PlayerRightScore = 0; txtScore.text = PlayerLeftScore.ToString() + " : " + PlayerRightScore.ToString(); StartGame(); }
public void UpdateScore(bool isRightPlayerLoseAPoint) { Destroy(ballController.gameObject); if (isRightPlayerLoseAPoint) { PlayerLeftScore++; txtNodification.text = "Left Player got a point!"; } else { PlayerRightScore++; txtNodification.text = "Right Player got a point!"; } txtScore.text = PlayerLeftScore.ToString() + " : " + PlayerRightScore.ToString(); state = GameState.END; }