using UnityEngine;
using System.Collections;

public class RaycastScript : MonoBehaviour {
	
	GameObject shape;
	GameObject MCamera;
	//Transform[] shapeChild;
	//Transform[]
	bool locked;
	// Use this for initialization
	void Start () {
		shape = GameObject.Find ("ShapeList");
		MCamera = GameObject.Find("Main Camera");
	}
	// Update is called once per frame

	public void checkLock () {
		int angle = Mathf.RoundToInt (shape.transform.eulerAngles.z);
        locked = MCamera.GetComponent<CameraMovementScript>().locked;
		if (!locked) {
			if ((angle >= 359 || angle <= 1)) {
				MCamera.GetComponent<CameraMovementScript> ().locked = true;
                MCamera.GetComponent<GameController>().DeleteOutline();
                MCamera.GetComponent<GameController>().score += 1;
			} else {
				MCamera.GetComponent<CameraMovementScript> ().locked = false;
			}
		}

	}
}
