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

public class TriggerDoor : MonoBehaviour {

	private Rigidbody rb;

	// Use this for initialization
	void Start () {
		rb = gameObject.GetComponent<Rigidbody> ();		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	void OnCollisionStay(Collision collisionInfo) {
		if (collisionInfo.gameObject.tag == "CubeCircuit") {
			if (collisionInfo.gameObject.GetComponent<CircuitCube> ().state == 1) {
				rb.AddForce (transform.up * 10);
			}
		}
	}


}
