Example #1
0
 public virtual void Die()
 {
     if (OnDieEvent != null)
     {
         OnDieEvent.Invoke();
     }
 }
Example #2
0
 protected virtual void OnDie(DieReason reason)
 {
     if (OnDieEvent != null)
     {
         OnDieEvent.Invoke(reason);
     }
 }
Example #3
0
    protected virtual void Die()
    {
        Disable();

        if (OnDieEvent != null)
        {
            OnDieEvent.Invoke(this);
        }
    }
Example #4
0
        private void Rpc_NotifyDied()
        {
            if (isLocalPlayer)
            {
                characterController.enabled = false;

                IsAlive = false;
                OnDieEvent?.Invoke();
            }
        }
Example #5
0
        private void Rpc_NotifyDied()
        {
            if (isLocalPlayer)
            {
                characterController.enabled = false;

                IsAlive = false;
                OnDieEvent?.Invoke();
            }

            if (dieEffectPrefab)
            {
                MstTimer.WaitForSeconds(1f, () => {
                    Instantiate(dieEffectPrefab, transform.position, Quaternion.identity);
                });
            }
        }
Example #6
0
        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);
        }
Example #7
0
 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);
 }
Example #8
0
 private void Die()
 {
     _isDead = true;
     OnDieEvent?.Invoke();
     Dispose();
 }
Example #9
0
 public void OnDie()
 {
     OnDieEvent.Invoke(this, EventArgs.Empty);
 }
Example #10
0
 protected virtual void OnDie()
 {
     IsAlive = false;
     OnDieEvent?.Invoke();
 }
Example #11
0
 protected virtual void InvokeDieEvent()
 {
     OnDieEvent?.Invoke(this);
 }
Example #12
0
 public void Die()
 {
     _isAlive = false;
     OnDieEvent?.Invoke(this);
 }