public void ImDead() { EnemyDead?.Invoke(); imAlive = false; deadNumber++; transform.position *= trashZone; }
public virtual void EnemyGoToDeadState() { myState.Exit(); myState = new EnemyDead(this); enemyDeadListener = (EnemyDead)myState; enemyDeadListener.OnEnemyDead += SpawnExperience; // Subscribes to publisher Debug.Log(myState); myState.Enter(); }
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); } }
public void OnEnemyDead(OnEnemyDeadEventArgs args) { EnemyDead?.Invoke(this, args); }
private void NotifyAboutDeath() { EnemyDead?.Invoke(this); Debug.Log(gameObject.name + " is dead"); }
public event UnityAction EnemyDead; // событие вызываемое при уничтожении вражеского корабля public void OnEnemyDead() { EnemyDead?.Invoke(); }