#pragma strict
var hit:boolean;
var count:int;
var playerController: MouseController;
var liveMinus:AudioClip;

function Start () {
	playerController = GameObject.FindGameObjectWithTag("Player").GetComponent(MouseController);
	hit=false;
	count = 0;
}

function Update () {
	
}

function OnTriggerEnter(objectHit:Collider){
	if(MainMenu2Controller.levelSelected == "Classic"){
		//hit = true;
		if(objectHit.gameObject.tag == "Apple" || objectHit.gameObject.tag == "Pineapple" || objectHit.gameObject.tag == "Lemon"){
			count++;
			Debug.Log("Before Method");
			audio.PlayOneShot(liveMinus);
			playerController.decreaseLive();
			//Debug.Log("Hit: " + count);
			Destroy(objectHit.gameObject);
		}else{
			Debug.Log("Game Object: " + objectHit.gameObject);
			Destroy(objectHit.gameObject);
		}
	}else{
		//Debug.Log("Game Object: " + objectHit.gameObject);
		Destroy(objectHit.gameObject);
	}
}