private void HandleMovement()
{
if (InputHandler.singleton.controls.GetAxis(InputHandler.AxisKey.Move) != 0.0f) {
Vector3 newMousePos = GetMousePosOnGrid();
Debug.DrawLine(prevMousePos, newMousePos, Color.red);
transform.Translate(prevMousePos - newMousePos, Space.World);
prevMousePos = GetMousePosOnGrid();
/*
Debug.LogFormat("{0}, {1}", InputHandler.singleton.controls.GetAxis(InputHandler.AxisKey.SelectionX),
InputHandler.singleton.controls.GetAxis(InputHandler.AxisKey.SelectionY));
*/
/*
transform.Translate(InputHandler.singleton.controls.GetAxis(InputHandler.AxisKey.SelectionX),
0.0f,
InputHandler.singleton.controls.GetAxis(InputHandler.AxisKey.SelectionY),
Space.World);
*/
}
else {//WHAT TO DO WHILE NOT CLICKING
dragMarkerPos = GetMousePosOnGrid();
prevMousePos = GetMousePosOnGrid();
}
transform.position = new Vector3(Mathf.Clamp(transform.position.x, clampReferencePoint.position.x - clampDistX, clampReferencePoint.position.x + clampDistX),
Mathf.Clamp(transform.position.y, clampReferencePoint.position.y - clampDistY, clampReferencePoint.position.y + clampDistY),
Mathf.Clamp(transform.position.z, clampReferencePoint.position.z - clampDistZ, clampReferencePoint.position.z + clampDistZ)
);
}