public override void Damage(Transform enemy) { base.Damage(enemy); // Dubuff_Burn StartCoroutine(BuffManager.ActiveBuff(enemy.gameObject.GetComponent <Enemy>(), buffElements_Burn)); // Q. transform 에서 이렇게 enemy object를 가져오는게 괜찮은 방법인지..? }
private void Laser() { if (targetEnemy != null) { //targetEnemy.TakeDamage(damageOverTime * Time.deltaTime); targetEnemy.TakeDamageByPercent(damageOverTime * Time.deltaTime); //targetEnemy.Slow(slowPercent); if (laserDubffCoroutin != null) { laserDubffCoroutin = StartCoroutine(BuffManager.ActiveBuff(targetEnemy, buffElementsMoveSlow)); } } if (!lineRenderer.enabled) { lineRenderer.enabled = true; laserBeamImpactEffect.Play(); laserBeamImpactLight.enabled = true; } lineRenderer.SetPosition(0, firePoint.position); lineRenderer.SetPosition(1, targetTransform.position); Vector3 dir = firePoint.position - targetTransform.position; laserBeamImpactEffect.transform.position = targetTransform.position + dir.normalized * 0.5f; laserBeamImpactEffect.transform.rotation = Quaternion.LookRotation(dir); }