using UnityEngine;
using System.Collections;

public class Wraparound : MonoBehaviour
{
	public float horz;
	public float vert;
	// Use this for initialization
	void Start ()
	{

	}
	
	// Update is called once per frame
	void Update ()
	{
		if (Mathf.Abs (transform.position.x) > horz + 0.1f)
			transform.position = new Vector3(-(Mathf.Sign(transform.position.x) * (Mathf.Abs(transform.position.x)-0.1f)),transform.position.y,transform.position.z);
		if (Mathf.Abs (transform.position.y) > vert + 0.1f)
			transform.position = new Vector3(transform.position.x,-(Mathf.Sign(transform.position.y) * (Mathf.Abs(transform.position.y)-0.1f)),transform.position.z);
	}
}
