示例#1
0
 void OnGameFinishedEvent(GameFinishedEvent e)
 {
     pauseButton.SetActive(false);
     cutsceneAnimator.gameObject.SetActive(true);
     cutsceneAnimator.Play("Default");
     cutsceneAnimator.SetTrigger("Outro");
 }
示例#2
0
 private void OnGameFinished(GameFinishedEvent @event)
 {
     _gameIO.DisplayMessage("Game Over!");
     _gameIO.DisplayLine();
     _isStarted = false;
     PlayAgain();
 }
示例#3
0
 private void OnGameOver()
 {
     Debug.Log("GAME OVERRR");
     sfxManager.Lose.PlayRandom();
     gameOver.SetActive(true);
     GameFinishedEvent?.Invoke(false);
     MatrixExit(false, 8f);
 }
示例#4
0
        private void OnTrackListFinished()
        {
            reachedEnd = true;
            youWin.SetActive(true);
            GameFinishedEvent?.Invoke(true);

            MatrixExit(true, 8);
            Debug.Log("Success! Last Track Finished!");
        }
示例#5
0
        private async void OnGameFinished(GameFinishedEvent @event)
        {
            if (@event.GameId != gameId)
            {
                return;
            }

            await clientProxy.SendAsync(nameof(IGameHubClient.OnGameFinished), @event);
        }
示例#6
0
        private void OnGameFinished(GameFinishedEvent obj)
        {
            DisableScene(ref _gameScene);
            _sceneHandler.UnloadScene(_gameSceneName);
            DisableScene(ref _hudScene);
            _sceneHandler.UnloadScene(_hudSceneName);

            ShowStartupScreen();
        }
示例#7
0
    protected override GameResult EvaluateVictory()
    {
        // TODO: Evaluate wtf has happened.
        string            victoryMessage = string.Empty;
        GameFinishedEvent evt            = new GameFinishedEvent(_timeController.Turns, _timeController.TimeUnits, GameResult.Won, victoryMessage);

        //_eventLog.EndSession(evt);

        return(GameResult.Running);
    }
        private void RaiseGameFinishedEvent(Game game)
        {
            var gameFinishedEvent = new GameFinishedEvent
            {
                GameId = game.GameId,
                Result = game.Result.Value.AsDto()
            };

            serviceBus.Publish(gameFinishedEvent);
        }
示例#9
0
    public void DestroyAllBlocks()
    {
        var blocks = GameObject.FindGameObjectsWithTag("Block");

        foreach (var block in blocks)
        {
            Destroy(block);
        }

        _blockCount = 0;
        if (_blockCount <= 0)
        {
            GameFinishedEvent?.Invoke();
        }
    }
示例#10
0
    private void State_End()
    {
        // update the player data object with the players name
        PlayerData.PlayerName = playerNameText;

        // we no-longer care if the button has been clicked, remove the listener
        playerNameAcceptButton.onClick.RemoveAllListeners();

        // reset our state for the next run
        currentState = States.PreStart;

        // let those listening know that we want to view high scores
        if (GameFinishedEvent != null)
        {
            GameFinishedEvent.Invoke();
        }

        // we are proceeding into the next part of the game, these views are no-longer needed
        HideAllViews();
    }
示例#11
0
    public void DestroyBlock(GameObject receivedBlock)
    {
        if (!receivedBlock.CompareTag("Block"))
        {
            return;
        }

        Destroy(receivedBlock);
        _blockCount--;

        AudioManager.Instance.PlayBlockDestroyedSound();

        var particles = Instantiate(DestroyingParticles, receivedBlock.transform.position, receivedBlock.transform.rotation);

        particles.GetComponent <ParticleSystem>().Play();
        Destroy(particles, 1f);

        _doubleBallBonus.Execute();
        _slowMoBallBonus.Execute();

        var receivedBlockId = receivedBlock.GetComponent <BlockId>().Id;

        var blockForRemove = CurrentLevelState.BlocksList.FirstOrDefault(t => t.Id == receivedBlockId);

        CurrentLevelState.BlocksList.Remove(blockForRemove);

        var amount = CurrentLevel.BlocksList
                     .Where(t => t.Id == receivedBlockId)
                     .Select(t => t.BlockScoreCost).FirstOrDefault();


        Score.AddAmountToScore(amount);

        if (_blockCount <= 0)
        {
            GameFinishedEvent?.Invoke();
        }
    }
示例#12
0
 public void EndSession(GameFinishedEvent evt)
 {
     AddEvent(evt);
     OnSessionFinished?.Invoke();
 }
示例#13
0
 private void GameFinished(GameFinishedEvent obj)
 {
     filler.Fill(obj.Content);
     SwitchMenu(EndScreenMenu);
 }
示例#14
0
        private void OnGameFinished(GameFinishedEvent gameFinishedEvent)
        {
            Result = gameFinishedEvent.Result.AsDomain();

            NotifyStateChanged();
        }
示例#15
0
 private async Task HandleFinishedEventAsync(GameFinishedEvent finishedEvent)
 => await _gameHub.Clients.All.SendAsync("GameFinishedAsync", _asDto.Game(finishedEvent.Game));
示例#16
0
 private void Board_OnGameFinished(object sender, Events.GameFinishedEvent e)
 {
     state          = GameState.Ended;
     gameFinishData = e;
 }