using UnityEngine;
using System.Collections;

public class IfTouch : MonoBehaviour {

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

		//first input is right, need after && to be when two collisions meet, how do I do that thou???
		if(Input.GetKeyDown(KeyCode.Space) && (other.gameObject.CompareTag("Player")))
		{	
			//use this to play a sound effect
			//GetComponent<AudioSource>().Play();
			print("You Win!");
		}
	}

	/*
	void OnTriggerEnter (Collider other ) {

		//if triggered & pressed space
		//do this
		print("Triggered");

		if(gameObject.name == "Icon"){

			//Destroy(col.gameObject); //DO SOMETHING!
			print("Collided");
			
		}
	
	}

	 void OnTriggerEnter(Collider other) {
        if (other.gameObject.CompareTag("Player"))
            Destroy(other.gameObject);
        
    }

	void OnCollisionEnter (Collision col){
	
		if(col.gameObject.name == "Icon"){

			//Destroy(col.gameObject); //DO SOMETHING!
			print("Collided");
			
		}
	}
	*/

}
