Beispiel #1
0
 public void ImDead()
 {
     EnemyDead?.Invoke();
     imAlive = false;
     deadNumber++;
     transform.position *= trashZone;
 }
Beispiel #2
0
    public virtual void EnemyGoToDeadState()
    {
        myState.Exit();
        myState = new EnemyDead(this);

        enemyDeadListener              = (EnemyDead)myState;
        enemyDeadListener.OnEnemyDead += SpawnExperience; // Subscribes to publisher
        Debug.Log(myState);
        myState.Enter();
    }
Beispiel #3
0
 public void Damage(int damageAmount)
 {
     //güncel candan hasarım çıkıyor can 0 a gelince ölüm animasyonu ve obje yok edilmesi
     currentHealth -= damageAmount;
     if (currentHealth <= 0)
     {
         EnemyDead?.Invoke();
         Death();
         Destroy(gameObject, deathTime);
     }
 }
    public override void ApplyDamage(int damage)
    {
        if (m_firstShot)
        {
            FirstShot();
            return;
        }

        m_currentHealth -= damage;
        m_HPUI.UpdateHealth(m_currentHealth);
        if (m_currentHealth <= 0)
        {
            m_currentHealth = 0;
            EnemyDead?.Invoke();
            if (m_ammoBox)
            {
                GameObject ammoBox = Instantiate(m_ammoBox, transform.position, Quaternion.identity);
                ammoBox.transform.parent = null;
            }
            gameObject.SetActive(false);
        }
    }
Beispiel #5
0
 public void OnEnemyDead(OnEnemyDeadEventArgs args)
 {
     EnemyDead?.Invoke(this, args);
 }
Beispiel #6
0
 private void NotifyAboutDeath()
 {
     EnemyDead?.Invoke(this); Debug.Log(gameObject.name + " is dead");
 }
Beispiel #7
0
    public event UnityAction EnemyDead;     // событие вызываемое при уничтожении вражеского корабля

    public void OnEnemyDead()
    {
        EnemyDead?.Invoke();
    }