using UnityEngine;
using System.Collections;

public class Shoot : MonoBehaviour {
	
	public GUITexture fire;
	public Transform thePrefab;

	void OnEnable(){
		Gesture.onMouse1E += Pressed;
		Gesture.onTouchE += Pressed;
	}
	
	void OnDisable(){
		Gesture.onMouse1E -= Pressed;
		Gesture.onTouchE -= Pressed;
	}
	
	void Pressed(Vector2 pos){
		
		
		if(fire.HitTest(pos)){
			Instantiate(thePrefab, transform.position, transform.rotation);
		}
	}

	
}
