var _hit : RaycastHit;

var _mainCamera : GameObject;
var _slicer : GameObject;

var _xyPosition : Vector2 = Vector2.zero;
var _xyPrevious : Vector2 = Vector2.zero;
var _xyDifference : Vector2 = Vector2.zero;
var _cam : boolean = false;

function Awake(){
	mainCamera = GameObject.Find("MainCamera");
}

function Update () {
	if(_cam){
	} 
	else{
	_xyPosition = Input.mousePosition;
	}

	_xyDifference = Vector2(_xyPosition.x-_xyPrevious.x,_xyPosition.y-_xyPrevious.y);
	
	// Construct a ray from the current mouse coordinates
	var _ray : Ray = _mainCamera.GetComponent(Camera).ScreenPointToRay (_xyPosition);
	if (Physics.Raycast (_ray, _hit)) {
		//Debug.Log(hit.transform.gameObject.name);
		if(_hit.transform.gameObject.CompareTag("background")){
			_slicer.transform.position = Vector3(_hit.point.x,_hit.point.y, 0);
			}
	}
	guiTexture.pixelInset = Rect (Input.mousePosition.x -16, Input.mousePosition.y -16, 32, 32);    
	_xyPrevious = _xyPosition; 
}