예제 #1
0
 protected virtual void OnDie(DieReason reason)
 {
     if (OnDieEvent != null)
     {
         OnDieEvent.Invoke(reason);
     }
 }
예제 #2
0
 public virtual void Die()
 {
     if (OnDieEvent != null)
     {
         OnDieEvent.Invoke();
     }
 }
예제 #3
0
 // Start is called before the first frame update
 protected virtual void Awake()
 {
     OnDie = new OnDieEvent();
     InitComponents();
     InitBehaviours();
     StartPosition = transform.position;
     StartRotation = transform.rotation;
 }
예제 #4
0
    protected virtual void Die()
    {
        Disable();

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

                IsAlive = false;
                OnDieEvent?.Invoke();
            }
        }
예제 #6
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);
                });
            }
        }
예제 #7
0
파일: EnemyHealth.cs 프로젝트: swet-s/Dark
 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);
 }
예제 #8
0
 private void Die()
 {
     _isDead = true;
     OnDieEvent?.Invoke();
     Dispose();
 }
예제 #9
0
 public void OnDie()
 {
     OnDieEvent.Invoke(this, EventArgs.Empty);
 }
예제 #10
0
 protected virtual void OnDie()
 {
     IsAlive = false;
     OnDieEvent?.Invoke();
 }
예제 #11
0
 protected virtual void InvokeDieEvent()
 {
     OnDieEvent?.Invoke(this);
 }
예제 #12
0
 public void Die()
 {
     _isAlive = false;
     OnDieEvent?.Invoke(this);
 }
예제 #13
0
 void Awake()
 {
     enemy_stats  = GetComponent <EnemyStats>();
     on_die_event = new OnDieEvent();
 }