Beispiel #1
0
        public void ShowWin(object o, PlayerEventArgs args)
        {
            _winImage.fillAmount = 1.0f;
            Time.timeScale       = 0.0f;

            _button.ActivateButton(true);
        }
Beispiel #2
0
        public void HealOrDamage(object o, PlayerEventArgs args)
        {
            if (args.IsLoading)
            {
                _currentPlayerHP = _healthData;
            }
            else
            {
                _currentPlayerHP = Mathf.Clamp(args.PlayerHealth, 0.0f, 1.0f);
            }

            _healthBar.fillAmount = _currentPlayerHP;

            if (_currentPlayerHP <= 0.0f)
            {
                _finishGameLabel.text = "You lost!";
                Time.timeScale        = 0.0f;

                _restartButton.ActivateButton(true);
            }
        }