want to drag & Drop a game Object and put into a specific area

I want to drag & Drop a game Object and put into a specific area of another game Object . if it’s not in specific area it’s came to initial place again…how do i do that?

using UnityEngine; using System.Collections;

[RequireComponent(typeof(MeshCollider))]

public class GizmosController : MonoBehaviour {

private Vector3 screenPoint;
private Vector3 offset;
void OnMouseDown() { screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position);

offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));

}

void OnMouseDrag() { Vector3 curScreenPoint = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z);

Vector3 curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint) + offset;
transform.position = curPosition;
}

}

I’ve tested this code before and it worked