public void StartLevel() { Coins = _gameManager.LevelController.CurrentLevel.LevelSettings.playerCoinsAmount; Health = _gameManager.LevelController.CurrentLevel.LevelSettings.playerHealthAmount; OnCoinsAmountChangedEvent?.Invoke(Coins); OnHealthAmountChangedEvent?.Invoke(Health); }
public void Damage(int damageAmount) { Health -= damageAmount; if (Health < 0) { Health = 0; } OnHealthAmountChangedEvent?.Invoke(Health); if (Health <= 0) { Die(); } }