using UnityEngine;
using System.Collections;

public class MeatPickup : MonoBehaviour {
    private float cooldown = 0.0f;

    public GameObject Sparklies;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
        cooldown += Time.deltaTime;
	
	}


    void OnTriggerStay(Collider other) {
        if (other.tag == "Player" && cooldown >= 0.5f) {

            Instantiate(Sparklies, transform.position, Quaternion.identity);
            FoodCounter.meat = FoodCounter.meat + 1;
            Destroy(this.gameObject);
        }
    }
}
