using UnityEngine;
using System.Collections;

[RequireComponent(typeof(Collider))]
public class Bouncer : MonoBehaviour
{
    private static float m_sLastCollideTime = 0.0f;

    void Update()
    {
    }

    void OnCollisionEnter(Collision col)
    {
        if (Time.realtimeSinceStartup - m_sLastCollideTime < 0.5f)
            return;

        if(col.rigidbody.tag == "Player")
        {
            Player.instance.OnHit();
            m_sLastCollideTime = Time.realtimeSinceStartup;
        }
    }
}