using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Bouncer : MonoBehaviour {
	public Text bouncerText;
	private float timer = 0;
	public AudioSource mainsong;
	public AudioSource remix;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		timer--;
		if (timer <= 0) {
			bouncerText.text = "";
		}
	}
	void OnCollisionEnter(Collision other){
		if (other.gameObject.name == "tempChar") {
			if (GameObject.Find ("GameManager").GetComponent<GameManager> ().points < 50) {
				bouncerText.text = "You must have a social value of 50 or above to get in";
				timer = 180;

			} else {
				Destroy (this.gameObject);
			}
		}

	}


}
