Exemplo n.º 1
0
    public Transform FindEnemyInDesperationAttackInRange()
    {
        List <EnemyStatusManager> nullEnemies = new List <EnemyStatusManager>();
        EnemyStatusManager        firstEnemy  = null;

        foreach (EnemyStatusManager enemy in EnemiesInRange)
        {
            if (enemy == null)
            {
                nullEnemies.Add(enemy);
                continue;
            }
            else
            {
                if (firstEnemy == null && enemy.IsExecutable())
                {
                    firstEnemy = enemy;
                }
            }

            continue;
        }

        RemoveNullEnemies(nullEnemies);

        if (firstEnemy == null)
        {
            return(null);
        }

        return(firstEnemy.transform);
    }
Exemplo n.º 2
0
 public void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == Constants.Tags.Enemy)
     {
         EnemyStatusManager enemy = other.gameObject.GetComponent <EnemyStatusManager>();
         if (enemy.IsExecutable() && IsDashing)
         {
             animator.SetTrigger("Execute");
             initialPosition = transform.position;
             DisableRigidbodyEffects();
             enemy.Executed();
             airDashed = false;
             playerStatus.RegenerateOnExecute(enemy);
             playerStatus.playerState = EPlayerState.Executing;
         }
         else
         {
             enemy.CollideWithPlayer();
         }
     }
 }
Exemplo n.º 3
0
 public void RegenerateOnExecute(EnemyStatusManager enemy)
 {
     RegenHealth(enemy.executeHealthDrop);
     RegenEnergy(enemy.executeEnergyDrop);
 }