static void DoStatusOverlays(
            Rect iconRect,
            IAssetStatusCache assetStatusCache,
            string path)
        {
            AssetsOverlays.AssetStatus statusesToDraw = DrawAssetOverlay.GetStatusesToDraw(
                assetStatusCache.GetStatusForPath(path));

            foreach (AssetsOverlays.AssetStatus status in Enum.GetValues(typeof(AssetsOverlays.AssetStatus)))
            {
                if (status == AssetsOverlays.AssetStatus.None)
                    continue;

                if (!statusesToDraw.HasFlag(status))
                    continue;

                GetChangesOverlayIcon.Data overlayIconData =
                    GetChangesOverlayIcon.ForAssetStatus(status);

                if (overlayIconData != null)
                {
                    Rect overlayIconRect = new Rect(
                        iconRect.x + overlayIconData.XOffset,
                        iconRect.y + overlayIconData.YOffset,
                        overlayIconData.Size, overlayIconData.Size);

                    GUI.DrawTexture(
                        overlayIconRect, overlayIconData.Texture,
                        ScaleMode.ScaleToFit);
                }
            }
        }
Пример #2
0
        static void DrawStatusLabels(
            AssetsOverlays.AssetStatus assetStatus,
            LockStatusData lockStatusData)
        {
            AssetsOverlays.AssetStatus statusesToDraw = DrawAssetOverlay.GetStatusesToDraw(assetStatus);

            foreach (AssetsOverlays.AssetStatus status in Enum.GetValues(typeof(AssetsOverlays.AssetStatus)))
            {
                if (status == AssetsOverlays.AssetStatus.None)
                {
                    continue;
                }

                if (!statusesToDraw.HasFlag(status))
                {
                    continue;
                }

                string label = string.Format("{0}",
                                             DrawAssetOverlay.GetStatusString(status));

                Texture icon = DrawAssetOverlay.DrawOverlayIcon.GetOverlayIcon(
                    status);

                string tooltipText = DrawAssetOverlay.GetTooltipText(
                    status, lockStatusData);

                GUILayout.Label(new GUIContent(
                                    label, icon, tooltipText), GUILayout.Height(18));
            }
        }