public static void IssueOnEnemyDied() { if (OnEnemyDied != null) { OnEnemyDied.Invoke(); } }
public void Damage(float damage) { if (enemy.TakeDamage(damage)) { OnEnemyDied?.Invoke(this); OnParticularEnemyDied?.Invoke(this); Destroy(gameObject); } }
public override void Enter() { base.Enter(); entity.isEnraged = false; entity.GetComponent <RespownAfterDeath>().isDead = true; entity.enabled = false; entity.rb.useGravity = false; entity.GetComponentInChildren <Collider>().enabled = false; entity.playerStats.currentExp += entity.entityData.expReward; entity.playerStats.LevelUp(); if (OnEnemyDied != null) { OnEnemyDied.Invoke(entity.entityData.mobID); } if (entity.lootTable != null) { entity.lootTable.RollLoot(); } }
protected override void Die() { Message <ReturnToPool <EnemyBehaviour> > .Raise(this); //invoke local event and clear the delegate. OnEnemyDied?.Invoke(); OnEnemyDied = null; //this used to be ondisable, but Die works just as fine inStrafeDistance = false; Destroy(GetComponent <PolygonCollider2D>()); //weird fix //yeet var system = DeathParticlePool.GetPoolObject(); system.transform.position = transform.position + new Vector3(0, 0, -1.5f); //position needs to be a little offset for it to render correctly. var main = system.Main; main.startColor = settings.tint; system.gameObject.SetActive(true); }
public void EnemyDied(Enemy enemy) => OnEnemyDied?.Invoke(enemy);
private void OnDestroy() { OnEnemyDied?.Invoke(this); }
public static void IDied(GameObject gameObject) { OnEnemyDied?.Invoke(gameObject); }
public void NotifyObservers() { OnEnemyDied?.Invoke(this); }
/// <summary> /// Call this method to notify the game manager that this unit is dead. /// </summary> /// <param name="enemyType">Enemy type</param> protected void OnDiedAction(EnemyType enemyType) { _isInit = false; OnDeductEnemy?.Invoke(enemyType); OnEnemyDied?.Invoke(enemyType); }
public static void ReportEnemyDied(Enemy _enemy) { OnEnemyDied?.Invoke(_enemy); //Debug.Log(_enemy.name + " Died"); }
private void EnemyDied(float amount) { OnEnemyDied?.Invoke(amount); }