示例#1
0
    EnemyDuel GetNonDuelingTarget()
    {
        //return enemyOnRange.GetListOfTargets()[0].GetComponent<EnemyDuel>();
        //
        //
        var targets = enemyOnRange.GetListOfTargets();

        foreach (GameObject tempEnemy in targets)
        {
            var tempEnemyDuel = tempEnemy.GetComponent <EnemyDuel>();
            if (tempEnemyDuel.IsOnDuelWithOtherThanMe(this))
            {
                continue;
            }
            else
            {
                return(tempEnemyDuel);
            }
        }
        if (enemyOnRange.GetListOfTargets().Count > 0)
        {
            return(enemyOnRange.GetListOfTargets()[0].GetComponent <EnemyDuel>());
        }
        return(null);
    }
示例#2
0
    void Shoot()
    {
        if (!reloadTimer.isReloaded)
        {
            return;
        }
        if (!enemyOnRangeChecker.HasValidTargetOnRange())
        {
            return;
        }
        if (duelData != null)
        {
            if (duelData.canAttack == false)
            {
                return;
            }
        }

        animator.Play("Attacking");
        Invoke("DoShoot", damageData.delayOfAttack);
        target = enemyOnRangeChecker.GetListOfTargets()[0];

        FaceTheTarget();

        reloadTimer.Start();
    }