using UnityEngine;
using System.Collections;

public class TakeDamageFromWaves : MonoBehaviour {

	// Use this for initialization
	GameObject gameManager;
	void Start () {
		gameManager = GameObject.Find ("GameManager");
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnTriggerEnter2D(Collider2D col)
	{
		//Debug.Log ("Collision");
		if (col.tag == "Wave") 
		{
			gameManager.GetComponent<GameManagerScript> ().TakeDamageFromWaves ();
		}
		if (col.tag == "Bubble") 
		{
			//Debug.Log ("bubble hit player");
			gameManager.GetComponent<GameManagerScript> ().TakeDamageFromBubbles ();
		}

		if (col.tag == "BashFish") 
		{
			gameManager.GetComponent<GameManagerScript> ().TakeDamageFromBashFish ();
		}

	}
}
