private void OnEnemyDied(EnemyDied e) { if (Service.StateManager.CurrentState == GameState.Playing) { score += e.EnemyValue; } }
/// <summary> /// Invokes when enemy is died. /// </summary> protected virtual void OnEnemyDied() { EnemyDied?.Invoke(this, new EnemyEventArgs() { EnemyType = this.type, ExperienceGained = this.experienceGained, GoldGained = this.goldGained, Position = this.position, IsAlive = this.isAlive }); }
protected virtual void OnEnemyDied() { if (EnemyDied != null) { EnemyDied.Invoke(this, EventArgs.Empty); } }
public void Die() { //создаем эффект смерти, на месте объекта и без поворотов //Instantiate(_deathEffect, transform.position, Quaternion.identity); EnemyDied?.Invoke(this); Destroy(gameObject); }
protected virtual void Die() { AnimationController.SetAnimationParameter(EnemyAnimatorParameter.Die); EnemyDied?.Invoke(this); contactCollider.enabled = false; GameManager.instance.screenUIController.gameResultUIController.ShowGameResultUI(true); }
protected virtual void OnDied(EnemyDeathEventArgs edeargs) { if (!this.Dead) { this.Dead = true; EnemyDied?.Invoke(this, edeargs); } }
public void Start(GameParameters parameters) { EnemyDied.AddListener(OnEnemyDied); EnemyPassedBy.AddListener(OnEnemyPassedBy); Coins = parameters.InitialCoins; Lives = parameters.Lives; }
private void RaiseEnemyDied(object sender, EventArgs e) { BaseNPC enemy = (BaseNPC)sender; Enemies.Remove(enemy); enemy.Dead = true; enemy.Died -= RaiseEnemyDied; EnemyDied?.Invoke(sender, e); }
private void OnEnemyDied(EnemyDied evt) { Debug.Log("Enemy Died: " + evt.PointValue); currentScore += evt.PointValue * currentMultiplier; //update points values scoreText.text = "Score: " + currentScore; //set the score text EventManager.Instance.Fire(new ScoreChanged(currentScore)); //fire scorechange event }
public void GetAttacked(int damage) { _health -= damage; if (_health <= 0) { EnemyDied?.Invoke(_gold); gameObject.SetActive(false); } }
//Call this method to destroy any enemies flagged for destruction and count down enemy total public void EnemyDestroy(EnemyDied evt) { enemies.Remove(evt.Enemy); GameObject.Destroy(evt.Enemy); Debug.Log("Enemy destroyed!"); if (enemies.Count <= 0) { enemies.Clear(); //I think this is redundant because enemies gets set again later, but that's probably fine EventManager.Instance.Fire(new Events.WaveEnd()); } }
public virtual void Die(bool hasFinishedLevel = false) { isDead = true; if (hasFinishedLevel) { deathTimer = 0; EnemyDied?.Invoke(this, collider, true); } else { // Enemy died UpdateRenderers(); dieParticleEffect.Play(); EnemyDied?.Invoke(this, collider, false); } }
public static void NotifyEnemyDied() { EnemyDied?.Invoke(); }
public static void OnEnemyDied() { EnemyDied?.Invoke(); }
private void Die() { EnemyDied?.Invoke(this); Destroy(gameObject); }
public void Enemyded(String EnemyNm) { //way to pass in multipel args clearly //runs all events named clickEvent EnemyDied?.Invoke(this, EnemyNm); }
private void OnEnemyDied(EnemyDied e) { EnemyKillTime.Add(Time.time); }
public static void CallEnemyDied() { EnemyDied?.Invoke(); }
void Awake( ) { _enemy_died = GetComponent <EnemyDied>( ); _collider = GetComponent <BoxCollider>( ); _enemy_died.enabled = false; }
public void OnEnemyDeath() { EnemyDied?.Invoke(); GameManager.Instance.GlobalUpdate -= GetComponent <EnemyVariousActions>().Behavior; }