using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class levelRestart : MonoBehaviour {

	void OnTriggerEnter(Collider collision) {
		if(collision.gameObject.tag == "Player") restartScene ();
        else if (collision.gameObject.tag == "Item") Destroy(collision.gameObject, 3f);
    }

	void restartScene() {
		SceneManager.LoadScene (SceneManager.GetActiveScene().buildIndex );
	}
}
