public void OnGameEnd(GameEndEvent e) { endGame = true; if (e.winner != null) { float pitch = e.winner.playerNum == 0 ? 0.8f : 2f; Services.AudioManager.CreateTrackAndPlay(Clips.WIN, pitch); _turnIndicatorIcon.sprite = e.winner.PlayerIcon; _turnIndicatorIcon.color = e.winner.playerColor[0]; _turnIndicator.color = e.winner.playerColor[0]; _turnIndicator.text = " WINS"; WinnerConfetti winnerConfetti = Instantiate(Services.Prefabs.WinnerConfetti); winnerConfetti.Init(e.winner); Task fadeGradient = new LERPColor(_gradient, _transparent, e.winner.playerColor[0], 0.75f); _tm.Do(fadeGradient); } else { Services.AudioManager.CreateTrackAndPlay(Clips.TIE); _turnIndicatorIcon.color = new Color(0, 0, 0, 0); _turnIndicator.color = new Color(127 / 256f, 127 / 256f, 127 / 256f); _turnIndicator.text = "TIE GAME"; Task fadeGradient = new LERPColor(_gradient, _transparent, _iconGray, 0.75f); _tm.Do(fadeGradient); } }
public void OnGameEnd(GameEndEvent e) { endGame = true; if (e.winner != null) { _turnIndicatorIcon.sprite = e.winner.PlayerIcon; _turnIndicatorIcon.color = e.winner.playerColor[0]; _turnIndicator.color = e.winner.playerColor[0]; _turnIndicator.text = " WINS"; WinnerConfetti winnerConfetti = Instantiate(Services.Prefabs.WinnerConfetti); winnerConfetti.Init(e.winner); Task fadeGradient = new LERPColor(_gradient, _transparent, e.winner.playerColor[0], 0.75f); _tm.Do(fadeGradient); } else { _turnIndicatorIcon.color = new Color(0, 0, 0, 0); _turnIndicator.color = new Color(127 / 256f, 127 / 256f, 127 / 256f); _turnIndicator.text = "TIE GAME"; Task fadeGradient = new LERPColor(_gradient, _transparent, _iconGray, 0.75f); _tm.Do(fadeGradient); } }