public virtual void Die() { if (OnDieEvent != null) { OnDieEvent.Invoke(); } }
protected virtual void OnDie(DieReason reason) { if (OnDieEvent != null) { OnDieEvent.Invoke(reason); } }
protected virtual void Die() { Disable(); if (OnDieEvent != null) { OnDieEvent.Invoke(this); } }
private void Rpc_NotifyDied() { if (isLocalPlayer) { characterController.enabled = false; IsAlive = false; OnDieEvent?.Invoke(); } }
private void Rpc_NotifyDied() { if (isLocalPlayer) { characterController.enabled = false; IsAlive = false; OnDieEvent?.Invoke(); } if (dieEffectPrefab) { MstTimer.WaitForSeconds(1f, () => { Instantiate(dieEffectPrefab, transform.position, Quaternion.identity); }); } }
public void TakeDamage(GameObject instigator, float damage) { if (IsDead) { return; } m_HealthPoints.Value = Mathf.Max(m_HealthPoints.Value - damage, 0); takeDamage?.Invoke(damage); OnHealthUpdate?.Invoke(); if (m_HealthPoints.Value >= Mathf.Epsilon) { return; } onDie?.Invoke(gameObject.name); Die(); AwardExperience(instigator); }
public void Die() { OnDieEvent.Invoke(); if (deathEffect && !transformTo) { GameObject deathEffectClone = Instantiate(deathEffect, transform.position, Quaternion.identity); Destroy(deathEffectClone, effectTime); } if (transformTo) { bool flipped = gameObject.GetComponent <Pius1>().isFlipped; GameObject deathEffectClone = Instantiate(deathEffect, transform.position, Quaternion.identity); Destroy(deathEffectClone, 0.1f); newbie = Instantiate(transformTo, transform.position, Quaternion.identity); newbie.transform.Rotate(0f, 180f, 0f); } Destroy(gameObject); }
private void Die() { _isDead = true; OnDieEvent?.Invoke(); Dispose(); }
public void OnDie() { OnDieEvent.Invoke(this, EventArgs.Empty); }
protected virtual void OnDie() { IsAlive = false; OnDieEvent?.Invoke(); }
protected virtual void InvokeDieEvent() { OnDieEvent?.Invoke(this); }
public void Die() { _isAlive = false; OnDieEvent?.Invoke(this); }