示例#1
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();
    }
示例#2
0
    public void Update()
    {
        if (towerTransform)
        {
            enemyOnRange.transform.position = towerTransform.position;
        }

        if (healthData.isDead)
        {
            CancelDuel();
            return;
        }

        if (enemyDuel)
        {
            if (enemyDuel.GetComponent <Health>().isDead)
            {
                CancelDuel();
                return;
            }
        }

        if (moverData.isMoving && (duelData.isMovingToDuel == false))
        {
            CancelDuel();
            return;
        }

        if (moverData.isMoving)
        {
            duelData.canAttack = false;
        }

        if (!enemyOnRange.HasValidTargetOnRange(enemyDuel))
        {
            CancelDuel();
            return;
        }

        if (enemyDuel == null)
        {
            enemyDuel = GetNonDuelingTarget();
        }

        PrepareToDuel();
    }
示例#3
0
    void Shoot()
    {
        if (!reloadTimer.isReloaded)
        {
            return;
        }
        if (!enemyOnRangeChecker.HasValidTargetOnRange())
        {
            return;
        }
        if (duelData != null)
        {
            if (duelData.canAttack == false)
            {
                return;
            }
        }


        transform.parent.GetComponentInChildren <Animator>().Play("Attacking");
        Invoke("DoShoot", damageData.delayOfAttack);
        reloadTimer.Start();
    }