So , i have an object which can be moved by mouse dragging.
the object can only move left or right but when it moves too left or too right it passes the wall and the object is invisble…

P.S :With C# and I need it to work on all the resolutions

    Vector3point=Camera.main.ScreenToWorldPoint(Input.mousePosition);
 point.z = gameObject.transform.position.z;
 point.y=gameObject.transform.position.y; 
gameObject.transform.position = point;

I think this post will do what you need Limit Movement of Object Based on Screen Size Unity2D - Unity Answers

If you want to clamp/restrict gameobjects on the boundary of Minimap, here are the links


Youtube:

Step by step tutorial: http://techscenarios.com/unity3d-clamp-objects-on-edges-of-minimap-clamp-on-minimap-boundary-free-scripts-part-4/