Beispiel #1
0
 void AnnounchPlayerDestroy()
 {
     if (OnPlayerDestroy != null)
     {
         OnPlayerDestroy.Invoke();
     }
 }
Beispiel #2
0
    private void DestroyPlayer()
    {
        if (destroyAudioClip != null)
        {
            AudioManager.Instance.EffectsAudioSource.PlayOneShot(destroyAudioClip);
        }

        OnPlayerDestroy?.Invoke();

        gameObject.SetActive(false);
    }
        public void UnRegisterEntity(Entity entity)
        {
            if (entity == null)
            {
                Debug.LogError($"제거하려는 {nameof(entity)}가 null입니다");
                return;
            }

            Entities.Remove(entity);
            if (entity is IDamageable)
            {
                Damageables.Remove((IDamageable)entity);
            }
            if (entity is Player)
            {
                Players.Remove((Player)entity);
                OnPlayerDestroy?.Invoke(this, (Player)entity);
            }
        }
Beispiel #4
0
 void OnDestroy()
 {
     OnPlayerDestroy?.Invoke(this);
 }