using UnityEngine;
using System.Collections;

public class btDirection_script : MonoBehaviour {

	public int direction;
	public SpriteRenderer spriteRender;
	public LayerMask layerMash;

	// Use this for initialization
	void Start () {

		//spriteRender = gameObject.GetComponent<SpriteRenderer>();
		//spriteRender.enabled = false;

		this.gameObject.SetActive (false);
	}
	
	// Update is called once per frame
	void Update () {
	
	}


	void OnMouseDown(){



			//Debug.DrawLine(ray.origin, hit.point);

		if(direction == Direction.UP)
		transform.parent.gameObject.GetComponent<ZombiesBehaviour> ().changeDirection (Direction.UP);
		if(direction == Direction.DOWN)
			transform.parent.gameObject.GetComponent<ZombiesBehaviour> ().changeDirection (Direction.DOWN);
		if(direction == Direction.RIGHT)
			transform.parent.gameObject.GetComponent<ZombiesBehaviour> ().changeDirection (Direction.RIGHT);
		if(direction == Direction.LEFT)
			transform.parent.gameObject.GetComponent<ZombiesBehaviour> ().changeDirection (Direction.LEFT);
	}
	
	public void setEnabled(bool param){
		spriteRender.enabled = param;

	}
}
