protected virtual void OnDie(DieReason reason) { if (OnDieEvent != null) { OnDieEvent.Invoke(reason); } }
public virtual void Die() { if (OnDieEvent != null) { OnDieEvent.Invoke(); } }
// Start is called before the first frame update protected virtual void Awake() { OnDie = new OnDieEvent(); InitComponents(); InitBehaviours(); StartPosition = transform.position; StartRotation = transform.rotation; }
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 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); }
void Awake() { enemy_stats = GetComponent <EnemyStats>(); on_die_event = new OnDieEvent(); }