using UnityEngine;
using System.Collections;

public class Fish : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void Fire() {
		Instantiate(Resources.Load("WaterSpit"),
		            transform.position + new Vector3(0, 0.5f, 0),
		            transform.rotation * Quaternion.Euler(0, -90, 0));
		//StartCoroutine("KeepFiring");
	}

	public IEnumerable KeepFiring() {
		for (int i = 0; i < 20; i ++) {
			Instantiate(Resources.Load("WaterSpit"),
			            transform.position + new Vector3(0, 0.5f, 0),
			            transform.rotation * Quaternion.Euler(0, -90, 0));
			yield return null;
		}
	}
}
