public void InvokePlayerDied() { InvokePauseLevel(true); PlayerDiedEvent?.Invoke(); CallEndgameMenu(); InvokeResetLevel(); }
private void CheckPlayerDied(IPlayerObject playerObject) { var isDead = playerObject.Stats[StatType.Health] < 1; if (isDead) { SetStat(playerObject.Id, StatType.Health, 0); playerObject.IsDead = true; PlayerDiedEvent?.Invoke(this, playerObject.Id); } }
public static int ChangeHealth(int damage) { health -= damage; FindObjectOfType <UiManager>().updateHealth(health); if (health <= 0) { PlayerDiedEvent?.Invoke(); } return(health); }
public void TakeDamage(float damageTaken) { if (m_canTakeDamage) { Debug.Log("Player Hit"); m_currentHealth -= damageTaken; onHealthChanged.Invoke(m_currentHealth, m_maxHealth); StartCoroutine(InvincibilityTime()); if (m_currentHealth <= 0) { onPlayerDied.Invoke(); } } }
public void GetPlayerDied(string login) { PlayerDiedEvent?.Invoke(login); }