public int SetTopMost() { var top = SortingOrder.GetNewTop(); SetOrder(top); return(top); }
void OnMouseDrag2() { //Debug.Log("on mouse drag"); Vector3 point = Camera.main.ScreenToWorldPoint(Input.mousePosition); point.z = gameObject.transform.position.z; Cursor.visible = false; if (firstClicked) { firstClicked = false; //render card as top most render.sortingOrder = SortingOrder.GetNewTop(); //remember offset so card doesn't jump to cursor location offset = gameObject.transform.position - point; } gameObject.transform.position = point + offset; }