/*using UnityEngine;
using System.Collections;

public class AIMovement : MonoBehaviour {
	public bool doneWalking = true;
	public Vector3 waypoint;
	private float speed =  4;
	public bool oob = false;
	public bool busy = false;
	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {
		float step = speed * Time.deltaTime;
		Vector3 targetdir = waypoint - transform.position;
		Vector3 newdir = Vector3.RotateTowards (transform.forward, targetdir, step, 0.0f);
		if (waypoint.x > 25 || waypoint.x < -25 || waypoint.z > 25 || waypoint.z < -25) {
			oob = true;
		}
		if (doneWalking) {
			waypoint = Random.insideUnitSphere * 30;
			waypoint.y = 0.5f;
			doneWalking = false;
			oob = false;
		} else {
			if (oob) {
				doneWalking = true;
			} else {
				if(!busy){
				transform.position = Vector3.MoveTowards (transform.position, waypoint, step);
				transform.rotation = Quaternion.LookRotation (newdir);
					if (transform.position == waypoint) {
						doneWalking = true;
					}
				}
			}
		}
	}
	void OnTriggerEnter(Collider other){
		oob = true;

	}
}*/
