コード例 #1
0
    public int SetTopMost()
    {
        var top = SortingOrder.GetNewTop();

        SetOrder(top);
        return(top);
    }
コード例 #2
0
ファイル: DragMe.cs プロジェクト: omikun/Epidemic
    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;
    }