Exemplo n.º 1
0
    protected void DoubleShoot()
    {
        ShotBasic shot = Instantiate(shotPrefab, transform.position + new Vector3(0f, 0.1f, 0f), Quaternion.identity).GetComponent <ShotBasic>();

        shot.setProperties(ShotProperties);
        shot.SetTarget(Target);
        shot = Instantiate(shotPrefab, transform.position + new Vector3(0f, -0.1f, 0f), Quaternion.identity).GetComponent <ShotBasic>();
        shot.setProperties(ShotProperties);
        shot.SetTarget(Target);
        increaseAttackSpeedWithShot();
        increaseAttackSpeedWithShot();
    }
Exemplo n.º 2
0
    protected override bool Attack()
    {
        Retarget(TowerProperties.Range);
        if (!TargetSet)
        {
            return(false);
        }
        CurrentCooldown = TowerProperties.Cooldown;

        ShotBasic shot = Instantiate(shotPrefab, transform.position, Quaternion.identity).GetComponent <ShotBasic>();

        shot.setProperties(ShotProperties);
        shot.SetTarget(Target);
        return(true);
    }
Exemplo n.º 3
0
    protected override bool Attack()
    {
        CastleProperties p = TowerProperties as CastleProperties;

        Retarget(TowerProperties.Range);
        if (!TargetSet)
        {
            return(false);
        }
        CurrentCooldown = TowerProperties.Cooldown;

        for (int i = 0; i < p.ShotCount; i++)
        {
            ShotBasic shot = Instantiate(shotPrefab, transform.position + new Vector3(0f, 0.1f * i, 0f), Quaternion.identity).GetComponent <ShotBasic>();
            shot.setProperties(ShotProperties);
            shot.SetTarget(Target);
        }
        return(true);
    }