using UnityEngine;
using System.Collections;

public class finish : MonoBehaviour {
	private static int count = 0;

	void OnTriggerEnter(Collider other){
		if (other.tag == "finish") {
			Debug.Log ("finish");
			if(count>=1){
				count = 0;
				Application.LoadLevel(Application.loadedLevel+1);	
			}
			else{
				count++;
				Destroy(this.gameObject);
			}
		}
	}
}
