예제 #1
0
        public void ProcessHit(GameObject obj = default)
        {
            _playerLives -= 1;
            _playerExplotion?.Play();
            _audioManager?.PlaySFX("PlayerExplosion");

            OnPlayerLivesUpdate?.Invoke(_playerLives);

            if (_playerLives == 0)
            {
                StartCoroutine(LoseGame());
                return;
            }

            StartCoroutine(ResetPlayer());
        }
예제 #2
0
 private void Start()
 {
     _gameManager  = ServiceLocator.Resolve <GameManager>();
     _audioManager = ServiceLocator.Resolve <AudioManager>();
     OnPlayerLivesUpdate?.Invoke(_playerLives);
 }