public void MoveToken(int diceNumber) { _tokenService.MoveToken(_token, diceNumber); if (_token.IsWinner()) { // This is normally an message event raised into Game class. OnWinEvent?.Invoke(this, null); } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Enemy") { isCatched = true; OnGameOverEvent?.Invoke(); } if (collision.gameObject.tag == "Finish") { isCatched = true; OnWinEvent?.Invoke(); } }
public void EndGame() { OnWinEvent?.Invoke(); gameEnded = true; }