public FolderIconPair GetIconsByColor(FolderColors color)
        {
            var colorFolder = ColorFolderIcons.Single(x => x.Color == color);

            return(new FolderIconPair {
                SmallIcon = colorFolder.SmallIcon, LargeIcon = colorFolder.LargeIcon
            });
        }
        public static void Colorize(FolderColors color)
        {
            if (color == FolderColors.Default)
            {
                RevertSelectedFoldersToDefault();
                return;
            }

            var icons = FolderColorsStorage.Instance.GetIconsByColor(color);
            ChangeSelectedFoldersIcons(icons);
        }
Example #3
0
        public static void Colorize(FolderColors color)
        {
            if (color == FolderColors.Default)
            {
                RevertSelectedFoldersToDefault();
                return;
            }

            var icons = FolderColorsStorage.Instance.GetIconsByColor(color);

            ChangeSelectedFoldersIcons(icons);
        }
        public static void Colorize(FolderColors color)
        {
            WarnAboutTwoColumnLayout();

            var selectedObj = Selection.activeObject;

            if (selectedObj == null)
            {
                Debug.LogWarning("Cannot apply color from the left column of the project view." +
                                 "Please right click the folder in the right column if you are using two-column layout");
                return;
            }

            if (!(selectedObj is DefaultAsset))
            {
                Debug.LogWarning(WARNING_MSG);
                return;
            }

            var path = AssetDatabase.GetAssetPath(selectedObj);

            if (!AssetDatabase.IsValidFolder(path))
            {
                Debug.LogWarning(WARNING_MSG);
                return;
            }

            var settings = RainbowFoldersSettings.Load();

            if (color != FolderColors.Default)
            {
                settings.ColorizeFolderByPath(path, FolderColorsStorage.GetInstance().GetFolderByColor(color));
            }
            else
            {
                settings.RemoveAllByPath(path);
            }
        }
        public static void Colorize(FolderColors color)
        {
            WarnAboutTwoColumnLayout();

            var selectedObj = Selection.activeObject;
            if (selectedObj == null)
            {
                Debug.LogWarning("Cannot apply color from the left column of the project view." +
                                 "Please right click the folder in the right column if you are using two-column layout");
                return;
            }

            if (!(selectedObj is DefaultAsset))
            {
                Debug.LogWarning(WARNING_MSG);
                return;
            }

            var path = AssetDatabase.GetAssetPath(selectedObj);
            if (!AssetDatabase.IsValidFolder(path))
            {
                Debug.LogWarning(WARNING_MSG);
                return;
            }

            var settings = RainbowFoldersSettings.Load();

            if (color != FolderColors.Default)
            {
                settings.ColorizeFolderByPath(path, FolderColorsStorage.GetInstance().GetFolderByColor(color));
            }
            else
            {
                settings.RemoveAllByPath(path);
            }
        }
 public RainbowColorFolder GetFolderByColor(FolderColors color)
 {
     return(ColorFolderIcons.Single(x => x.Color == color));
 }