Esempio n. 1
0
    public void Initialize()
    {
        _playerDeadSignal.Event += OnPlayerDead;

        //Add GameOverUI  button action
        _gameOverUI.Hide();
        _gameOverUI.RetryButton.onClick.AddListener(StartGame);
        _gameOverUI.ExitButton.onClick.AddListener(Dispose);
    }
Esempio n. 2
0
    private void Start()
    {
        var stats = PlayerManager.Instance.Player.GetComponent <CharacterStats>();

        stats.DieAction += PlayerDied;
        _gameOverUI.Hide();

        var enemies = FindObjectsOfType <Enemy>().ToList();

        enemies.ForEach(e => e.GetComponent <CharacterStats>().DieAction += TrackEnemies);
        _enemyCount = enemies.Count;
    }
    public override void Execute(object data)
    {
        GameSetting.Instance.playSound.PlayBgAudio(Const.Bgm_ZhanDou);
        GameModel      gameModel      = GetModel <GameModel>();
        GameOverUI     gameOverUI     = GetView <GameOverUI>();
        ContinueGameUI continueGameUI = GetView <ContinueGameUI>();

        if ((bool)data)
        {
            gameModel.IsOver = false;
            //gameModel.IsPause = false;
            GameSetting.Instance.playSound.PlayStepAudio();
        }
        else
        {
            gameModel.IsOver = true;
            //Time.timeScale = 1;
            gameOverUI.Hide();
            continueGameUI.Show("payContinue");
        }
    }