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

public class weightPlate : MonoBehaviour {

	public int   triggerMax = 1;
    public int triggerMin = 1;

    public bool triggered = false;
	public int  counter   = 0;

	public bool returnState() {
		return triggered;
	}

	void OnCollisionEnter(Collision collision) {
		if(collision.gameObject.tag == "Item" || collision.gameObject.tag == "Player")counter++;
		if (counter >= triggerMax) {
			triggered = true;
		}
	}

	void OnCollisionExit(Collision collision) {
		if(collision.gameObject.tag == "Item" || collision.gameObject.tag == "Player")counter--;
		if (counter <= triggerMin) {
			triggered = false;
		}
	}

}
