示例#1
0
 private void OnEnemyDied(EnemyDied e)
 {
     if (Service.StateManager.CurrentState == GameState.Playing)
     {
         score += e.EnemyValue;
     }
 }
示例#2
0
 /// <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
     });
 }
示例#3
0
 protected virtual void OnEnemyDied()
 {
     if (EnemyDied != null)
     {
         EnemyDied.Invoke(this, EventArgs.Empty);
     }
 }
示例#4
0
 public void Die()
 {
     //создаем эффект смерти, на месте объекта и без поворотов
     //Instantiate(_deathEffect, transform.position, Quaternion.identity);
     EnemyDied?.Invoke(this);
     Destroy(gameObject);
 }
示例#5
0
    protected virtual void Die()
    {
        AnimationController.SetAnimationParameter(EnemyAnimatorParameter.Die);
        EnemyDied?.Invoke(this);
        contactCollider.enabled = false;

        GameManager.instance.screenUIController.gameResultUIController.ShowGameResultUI(true);
    }
示例#6
0
 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;
        }
示例#8
0
        private void RaiseEnemyDied(object sender, EventArgs e)
        {
            BaseNPC enemy = (BaseNPC)sender;

            Enemies.Remove(enemy);
            enemy.Dead  = true;
            enemy.Died -= RaiseEnemyDied;
            EnemyDied?.Invoke(sender, e);
        }
示例#9
0
    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
    }
示例#10
0
 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());
        }
    }
示例#12
0
    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);
        }
    }
示例#13
0
 public static void NotifyEnemyDied()
 {
     EnemyDied?.Invoke();
 }
示例#14
0
 public static void OnEnemyDied()
 {
     EnemyDied?.Invoke();
 }
示例#15
0
文件: Enemy.cs 项目: pdgrv/SHK-Unity
 private void Die()
 {
     EnemyDied?.Invoke(this);
     Destroy(gameObject);
 }
示例#16
0
 public void Enemyded(String EnemyNm)
 {
     //way to pass in multipel args clearly
     //runs all events named clickEvent
     EnemyDied?.Invoke(this, EnemyNm);
 }
示例#17
0
 private void OnEnemyDied(EnemyDied e)
 {
     EnemyKillTime.Add(Time.time);
 }
示例#18
0
 public static void CallEnemyDied()
 {
     EnemyDied?.Invoke();
 }
示例#19
0
 void Awake( )
 {
     _enemy_died         = GetComponent <EnemyDied>( );
     _collider           = GetComponent <BoxCollider>( );
     _enemy_died.enabled = false;
 }
示例#20
0
文件: Enemy.cs 项目: sdavidlee/re-gun
 public void OnEnemyDeath()
 {
     EnemyDied?.Invoke();
     GameManager.Instance.GlobalUpdate -= GetComponent <EnemyVariousActions>().Behavior;
 }