コード例 #1
0
    public static void DrawThumbnailEndUsersTooltip(Rect position, string assetPath, GUIContent label,
                                                    List <GUIContent> endUsers, Rect assetRect)
    {
        var thumbnailImage = BRT_BuildReportWindow.GetAssetPreview(assetPath);

        if (thumbnailImage != null)
        {
            var usedBySpacing = 5;

            var thumbnailSize = BRT_BuildReportWindow.GetThumbnailSize();

            // compute end users height and width
            // then create a tooltip size that encompasses both thumbnail and end users list

            Vector2 endUsersSize = BRT_BuildReportWindow.GetEndUsersListSize(label, endUsers);
            endUsersSize.y += usedBySpacing;

            Vector2 tooltipSize = new Vector2(Mathf.Max(thumbnailSize.x, endUsersSize.x),
                                              thumbnailSize.y + endUsersSize.y);

            var tooltipRect = BRT_BuildReportWindow.DrawTooltip(position, assetRect,
                                                                tooltipSize.x, tooltipSize.y);

            // --------
            // now draw the contents

            BRT_BuildReportWindow.DrawThumbnail(tooltipRect.x, tooltipRect.y, thumbnailSize, thumbnailImage);

            var endUsersPos = tooltipRect.position;
            endUsersPos.y += thumbnailSize.y + usedBySpacing;
            BRT_BuildReportWindow.DrawEndUsersList(endUsersPos, label, endUsers);
        }
    }
コード例 #2
0
    public static void DrawEndUsersTooltip(Rect position, GUIContent label, List <GUIContent> endUsers, Rect assetRect)
    {
        var endUsersSize = BRT_BuildReportWindow.GetEndUsersListSize(label, endUsers);

        var tooltipRect = BRT_BuildReportWindow.DrawTooltip(position, assetRect,
                                                            endUsersSize.x, endUsersSize.y);

        BRT_BuildReportWindow.DrawEndUsersList(tooltipRect.position, label, endUsers);
    }