using Assets.Scripts.GameSession; using TMPro; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; namespace UI.Views { public class DeathScreen1VS1 : MonoBehaviour { public TMP_Text Joueur1Text; public TMP_Text Joueur2Text; public TMP_Text CoinsText; public TMP_Text ScoreText; private void Start() { if (!string.IsNullOrEmpty(GameResult.MatchResult)) { switch (GameResult.MatchResult) { case "PLAYER1": if(Joueur2Text != null) Joueur1Text.text = "WINNER !"; if(Joueur2Text != null) Joueur2Text.text = "LOSER !"; break; case "PLAYER2": if(Joueur2Text != null ) Joueur2Text.text = "WINNER !"; if(Joueur2Text != null) Joueur1Text.text = "LOSER !"; break; case "DRAW": if(Joueur1Text != null) Joueur1Text.text = "Draw"; if(Joueur2Text != null) Joueur2Text.text = "Draw"; break; } } else { } CoinsText.text = GameResult.coinsEarned.ToString(); ScoreText.text = GameResult.score.ToString() + "M"; } public void RestartGame() { SceneManager.LoadScene("DuoGameScene"); } public void QuitGame() { Application.Quit(); } } }