Exemplo n.º 1
0
    void Laser()
    {
        if (targetEnemy.health > 0)
        {
            targetEnemy.TakeDamage(damageOverTime * Time.deltaTime);
        }

        if (!targetEnemy.isBoss)
        {
            targetEnemy.Slow(slowAmount);
        }

        if (!lineRenderer.enabled)
        {
            lineRenderer.enabled = true;
            impactEffect.SetActive(true);
        }

        lineRenderer.SetPosition(0, firePoint.position);
        lineRenderer.SetPosition(1, target.position);

        Vector3 dir = firePoint.position - target.position;

        impactEffect.transform.position = target.position + dir.normalized / 10;
    }
Exemplo n.º 2
0
    void Damage(Transform enemy)
    {
        TD_SBF_Enemy e = enemy.GetComponent <TD_SBF_Enemy>();

        if (e)
        {
            e.TakeDamage(damage);
        }
    }