using UnityEngine;
using System.Collections;

public class LaserBeam : MonoBehaviour 
{
	public int damage = 20;
	void Start()
	{
		damage = transform.parent.gameObject.GetComponent<Projectile>().damage;
	}
	void OnTriggerEnter(Collider damageCheck)
	{
		if(damageCheck.gameObject.GetComponent<BaseEnemy>() != null)
		{
			damageCheck.gameObject.GetComponent<BaseEnemy>().TakeDamage(damage);
		}
		if(damageCheck.gameObject.GetComponent<EnemyFighter>() != null)
		{
			damageCheck.gameObject.GetComponent<EnemyFighter>().TakeDamage(damage);
		}
		if(damageCheck.gameObject.GetComponent<Boss>() != null)
		{
			damageCheck.gameObject.GetComponent<Boss>().TakeDamage(damage);
		}
	}
}
