From 710afaa264891aaf2472bc4571f5cdbc54d7f30e Mon Sep 17 00:00:00 2001 From: Palkia <4palkia4@gmail.com> Date: Fri, 3 Dec 2021 00:30:39 +0200 Subject: [PATCH 1/6] converted into a package for unity 2020 --- Editor.meta | 8 + Editor/EditorIcons.asmdef | 14 + Editor/EditorIcons.asmdef.meta | 7 + EditorIcons.cs => Editor/EditorIcons.cs | 488 ++++++++++---------- Editor/EditorIcons.cs.meta | 11 + preview-tall.png => Editor/preview-tall.png | Bin Editor/preview-tall.png.meta | 96 ++++ preview.png => Editor/preview.png | Bin Editor/preview.png.meta | 96 ++++ README.md.meta | 7 + package.json | 12 + package.json.meta | 7 + 12 files changed, 504 insertions(+), 242 deletions(-) create mode 100644 Editor.meta create mode 100644 Editor/EditorIcons.asmdef create mode 100644 Editor/EditorIcons.asmdef.meta rename EditorIcons.cs => Editor/EditorIcons.cs (75%) create mode 100644 Editor/EditorIcons.cs.meta rename preview-tall.png => Editor/preview-tall.png (100%) create mode 100644 Editor/preview-tall.png.meta rename preview.png => Editor/preview.png (100%) create mode 100644 Editor/preview.png.meta create mode 100644 README.md.meta create mode 100644 package.json create mode 100644 package.json.meta diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000..995d8ad --- /dev/null +++ b/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d61a0f05a9ff0bb4cb0fac6830679a91 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/EditorIcons.asmdef b/Editor/EditorIcons.asmdef new file mode 100644 index 0000000..644a9a8 --- /dev/null +++ b/Editor/EditorIcons.asmdef @@ -0,0 +1,14 @@ +{ + "name": "EditorIcons", + "rootNamespace": "Halak.EditorIcons", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/EditorIcons.asmdef.meta b/Editor/EditorIcons.asmdef.meta new file mode 100644 index 0000000..53f7c87 --- /dev/null +++ b/Editor/EditorIcons.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b84845740e8bb04c902c3ca2d91adae +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EditorIcons.cs b/Editor/EditorIcons.cs similarity index 75% rename from EditorIcons.cs rename to Editor/EditorIcons.cs index a87900d..7da834f 100644 --- a/EditorIcons.cs +++ b/Editor/EditorIcons.cs @@ -6,330 +6,333 @@ using System.Linq; using System.IO; -public class EditorIcons : EditorWindow +namespace Halak.EditorIcons { - [MenuItem("Tools/Editor Icons %e", priority = -1001)] - public static void EditorIconsOpen() + public class EditorIcons : EditorWindow { - var w = CreateWindow("Editor Icons"); - w.ShowUtility(); - w.minSize = new Vector2(320, 450); - } + [MenuItem("Tools/Editor Icons %e", priority = -1001)] + public static void EditorIconsOpen() + { + var w = CreateWindow("Editor Icons"); + w.ShowUtility(); + w.minSize = new Vector2(320, 450); + } - static bool viewBigIcons = true; + static bool viewBigIcons = true; - static bool darkPreview = true; + static bool darkPreview = true; - Vector2 scroll; + Vector2 scroll; - int buttonSize = 70; + int buttonSize = 70; - string search = ""; + string search = ""; - void SearchGUI() - { - using( new GUILayout.HorizontalScope()) + void SearchGUI() { - if (isWide) GUILayout.Space(10); + using (new GUILayout.HorizontalScope()) + { + if (isWide) GUILayout.Space(10); - search = EditorGUILayout.TextField(search, EditorStyles.toolbarSearchField); - if ( GUILayout.Button(EditorGUIUtility.IconContent("winbtn_mac_close_h"), //SVN_DeletedLocal - EditorStyles.toolbarButton, - GUILayout.Width(22)) - ) search = ""; + search = EditorGUILayout.TextField(search, EditorStyles.toolbarSearchField); + if (GUILayout.Button(EditorGUIUtility.IconContent("winbtn_mac_close_h"), //SVN_DeletedLocal + EditorStyles.toolbarButton, + GUILayout.Width(22)) + ) search = ""; + } } - } - bool isWide => Screen.width > 550; + bool isWide => Screen.width > 550; - bool doSearch => ! string.IsNullOrWhiteSpace(search) && search != ""; + bool doSearch => !string.IsNullOrWhiteSpace(search) && search != ""; - GUIContent GetIcon( string icon_name ) - { - GUIContent valid = null; - Debug.unityLogger.logEnabled = false; - if (!string.IsNullOrEmpty(icon_name)) valid = EditorGUIUtility.IconContent(icon_name); - Debug.unityLogger.logEnabled = true; - return valid?.image == null ? null : valid; - } - - void SaveIcon( string icon_name ) - { - Texture2D tex = EditorGUIUtility.IconContent(icon_name).image as Texture2D; + GUIContent GetIcon(string icon_name) + { + GUIContent valid = null; + Debug.unityLogger.logEnabled = false; + if (!string.IsNullOrEmpty(icon_name)) valid = EditorGUIUtility.IconContent(icon_name); + Debug.unityLogger.logEnabled = true; + return valid?.image == null ? null : valid; + } - if (tex != null) + void SaveIcon(string icon_name) { - string path = EditorUtility.SaveFilePanel( - "Save icon", "", icon_name, "png"); + Texture2D tex = EditorGUIUtility.IconContent(icon_name).image as Texture2D; - if (path != null) + if (tex != null) { - try + string path = EditorUtility.SaveFilePanel( + "Save icon", "", icon_name, "png"); + + if (path != null) { - Texture2D outTex = new Texture2D( - tex.width, tex.height, - tex.format, tex.mipmapCount, true); + try + { + Texture2D outTex = new Texture2D( + tex.width, tex.height, + tex.format, tex.mipmapCount, true); - Graphics.CopyTexture(tex, outTex); + Graphics.CopyTexture(tex, outTex); - File.WriteAllBytes(path, outTex.EncodeToPNG()); - } - catch (System.Exception e) - { - Debug.LogError("Cannot save the icon : " + e.Message); + File.WriteAllBytes(path, outTex.EncodeToPNG()); + } + catch (System.Exception e) + { + Debug.LogError("Cannot save the icon : " + e.Message); + } } } + else + { + Debug.LogError("Cannot save the icon : null texture error!"); + } } - else - { - Debug.LogError("Cannot save the icon : null texture error!"); - } - } - private void OnEnable() - { - //InitIcons(); - //var all_icons = iconContentListAll.Select(x => x.tooltip).ToArray(); - var all_icons = ico_list.Where( x => GetIcon( x ) != null ); - //List found = new List(); - List unique = new List(); - //var skip_flag = HideFlags.HideInInspector | HideFlags.HideAndDontSave; - //int unique_to_resources = 0, skipped_empty_str = 0, skipped_flags = 0, - // skipped_not_persistent = 0, skipped_nulls = 0, unique_to_list = 0; - - foreach (Texture2D x in Resources.FindObjectsOfTypeAll()) + private void OnEnable() { - //if (string.IsNullOrEmpty(x.name)) skipped_empty_str++; // skipped 10 empty - //if (!EditorUtility.IsPersistent(x)) skipped_not_persistent++; // skipped 39 none persistent - //if (x.hideFlags != HideFlags.HideAndDontSave && x.hideFlags != skip_flag) skipped_flags++; // skipped 27 icons - - GUIContent icoContent = GetIcon( x.name ); - if ( icoContent == null ) continue; // skipped 14 icons - //{ - // skipped_nulls++; - // continue; - //} - - if (!all_icons.Contains(x.name)) + //InitIcons(); + //var all_icons = iconContentListAll.Select(x => x.tooltip).ToArray(); + var all_icons = ico_list.Where(x => GetIcon(x) != null); + //List found = new List(); + List unique = new List(); + //var skip_flag = HideFlags.HideInInspector | HideFlags.HideAndDontSave; + //int unique_to_resources = 0, skipped_empty_str = 0, skipped_flags = 0, + // skipped_not_persistent = 0, skipped_nulls = 0, unique_to_list = 0; + + foreach (Texture2D x in Resources.FindObjectsOfTypeAll()) { - //unique_to_resources++; - unique.Add(x.name); + //if (string.IsNullOrEmpty(x.name)) skipped_empty_str++; // skipped 10 empty + //if (!EditorUtility.IsPersistent(x)) skipped_not_persistent++; // skipped 39 none persistent + //if (x.hideFlags != HideFlags.HideAndDontSave && x.hideFlags != skip_flag) skipped_flags++; // skipped 27 icons + + GUIContent icoContent = GetIcon(x.name); + if (icoContent == null) continue; // skipped 14 icons + //{ + // skipped_nulls++; + // continue; + //} + + if (!all_icons.Contains(x.name)) + { + //unique_to_resources++; + unique.Add(x.name); + } + + //found.Add( x.name ); } - - //found.Add( x.name ); - } - //foreach (var ico in all_icons) if (!found.Contains(ico)) unique_to_list++; + //foreach (var ico in all_icons) if (!found.Contains(ico)) unique_to_list++; - //Debug.Log( $"Resources skipped nulls={skipped_nulls} empty={skipped_empty_str} flags={skipped_flags}" ); - //Debug.Log("Resources skipped_not_persistent=" + skipped_not_persistent); - //Debug.Log($"totals , list: {all_icons.Length} resource: {found.Count}"); - //Debug.Log($"Unique list={ unique_to_list } resources={unique_to_resources}") ; + //Debug.Log( $"Resources skipped nulls={skipped_nulls} empty={skipped_empty_str} flags={skipped_flags}" ); + //Debug.Log("Resources skipped_not_persistent=" + skipped_not_persistent); + //Debug.Log($"totals , list: {all_icons.Length} resource: {found.Count}"); + //Debug.Log($"Unique list={ unique_to_list } resources={unique_to_resources}") ; - ico_list = ico_list.ToList().Concat(unique).ToArray(); + ico_list = ico_list.ToList().Concat(unique).ToArray(); - // Static list icons count : 1315 ( unique = 749 ) - // Found icons in resources : 1416 ( unique = 855 ) + // Static list icons count : 1315 ( unique = 749 ) + // Found icons in resources : 1416 ( unique = 855 ) - Resources.UnloadUnusedAssets(); - System.GC.Collect(); - } + Resources.UnloadUnusedAssets(); + System.GC.Collect(); + } - private void OnGUI() - { - var ppp = EditorGUIUtility.pixelsPerPoint; + private void OnGUI() + { + var ppp = EditorGUIUtility.pixelsPerPoint; - InitIcons(); + InitIcons(); - if (!isWide) SearchGUI(); + if (!isWide) SearchGUI(); - using ( new GUILayout.HorizontalScope( EditorStyles.toolbar ) ) - { - GUILayout.Label("Select what icons to show", GUILayout.Width( 160 )); - viewBigIcons = GUILayout.SelectionGrid( - viewBigIcons ? 1 : 0, new string[] { "Small", "Big" }, - 2 , EditorStyles.toolbarButton) == 1; + using (new GUILayout.HorizontalScope(EditorStyles.toolbar)) + { + GUILayout.Label("Select what icons to show", GUILayout.Width(160)); + viewBigIcons = GUILayout.SelectionGrid( + viewBigIcons ? 1 : 0, new string[] { "Small", "Big" }, + 2, EditorStyles.toolbarButton) == 1; - if (isWide) SearchGUI(); - } + if (isWide) SearchGUI(); + } - if (isWide) GUILayout.Space(3); + if (isWide) GUILayout.Space(3); - using (var scope = new GUILayout.ScrollViewScope(scroll)) - { - GUILayout.Space(10); + using (var scope = new GUILayout.ScrollViewScope(scroll)) + { + GUILayout.Space(10); - scroll = scope.scrollPosition; + scroll = scope.scrollPosition; - buttonSize = viewBigIcons ? 70 : 40; + buttonSize = viewBigIcons ? 70 : 40; - // scrollbar_width = ~ 12.5 - var render_width = (Screen.width / ppp - 13f); - var gridW = Mathf.FloorToInt( render_width / buttonSize ); - var margin_left = ( render_width - buttonSize * gridW ) / 2; + // scrollbar_width = ~ 12.5 + var render_width = (Screen.width / ppp - 13f); + var gridW = Mathf.FloorToInt(render_width / buttonSize); + var margin_left = (render_width - buttonSize * gridW) / 2; - int row = 0, index = 0; + int row = 0, index = 0; - List iconList; + List iconList; - if( doSearch ) iconList = iconContentListAll.Where( x => x.tooltip.ToLower() - .Contains( search.ToLower() ) ).ToList(); - else iconList = viewBigIcons ? iconContentListBig : iconContentListSmall; + if (doSearch) iconList = iconContentListAll.Where(x => x.tooltip.ToLower() + .Contains(search.ToLower())).ToList(); + else iconList = viewBigIcons ? iconContentListBig : iconContentListSmall; - while ( index < iconList.Count ) - { - using( new GUILayout.HorizontalScope() ) + while (index < iconList.Count) { - GUILayout.Space(margin_left); - - for( var i = 0; i < gridW; ++ i ) + using (new GUILayout.HorizontalScope()) { - int k = i + row * gridW; + GUILayout.Space(margin_left); - var icon = iconList[ k ]; + for (var i = 0; i < gridW; ++i) + { + int k = i + row * gridW; - if (GUILayout.Button(icon, - iconButtonStyle, - GUILayout.Width(buttonSize), - GUILayout.Height(buttonSize))) { - EditorGUI.FocusTextInControl(""); - iconSelected = icon; - } + var icon = iconList[k]; - index ++ ; + if (GUILayout.Button(icon, + iconButtonStyle, + GUILayout.Width(buttonSize), + GUILayout.Height(buttonSize))) + { + EditorGUI.FocusTextInControl(""); + iconSelected = icon; + } - if( index == iconList.Count ) break; + index++; + + if (index == iconList.Count) break; + } } + + row++; } - row ++ ; + GUILayout.Space(10); } - GUILayout.Space(10); - } + if (iconSelected == null) return; - if (iconSelected == null) return; - - GUILayout.FlexibleSpace(); + GUILayout.FlexibleSpace(); - using (new GUILayout.HorizontalScope( EditorStyles.helpBox, GUILayout.MaxHeight(viewBigIcons ? 140 : 120 ) ) ) - { - using( new GUILayout.VerticalScope( GUILayout.Width( 130 ) ) ) + using (new GUILayout.HorizontalScope(EditorStyles.helpBox, GUILayout.MaxHeight(viewBigIcons ? 140 : 120))) { - GUILayout.Space(2); - - GUILayout.Button(iconSelected, - darkPreview? iconPreviewBlack:iconPreviewWhite, - GUILayout.Width(128), GUILayout.Height( viewBigIcons ? 128 : 40 )); - - GUILayout.Space(5); - - darkPreview = GUILayout.SelectionGrid( - darkPreview ? 1 : 0, new string[] { "Light", "Dark" }, - 2, EditorStyles.miniButton) == 1; - - GUILayout.FlexibleSpace(); - } + using (new GUILayout.VerticalScope(GUILayout.Width(130))) + { + GUILayout.Space(2); - GUILayout.Space(10); + GUILayout.Button(iconSelected, + darkPreview ? iconPreviewBlack : iconPreviewWhite, + GUILayout.Width(128), GUILayout.Height(viewBigIcons ? 128 : 40)); - using (new GUILayout.VerticalScope()) - { - var s = $"Size: {iconSelected.image.width}x{iconSelected.image.height}"; - s += "\nIs Pro Skin Icon: " + ( iconSelected.tooltip.IndexOf("d_") == 0 ? "Yes" : "No" ); - s += $"\nTotal {iconContentListAll.Count} icons"; - GUILayout.Space(5); - EditorGUILayout.HelpBox(s,MessageType.None); - GUILayout.Space(5); - EditorGUILayout.TextField("EditorGUIUtility.IconContent(\"" + iconSelected.tooltip + "\")"); - GUILayout.Space(5); - if(GUILayout.Button("Copy to clipboard",EditorStyles.miniButton)) - EditorGUIUtility.systemCopyBuffer = iconSelected.tooltip; - if(GUILayout.Button("Save icon to file ...",EditorStyles.miniButton)) - SaveIcon(iconSelected.tooltip); - } + GUILayout.Space(5); - GUILayout.Space(10); + darkPreview = GUILayout.SelectionGrid( + darkPreview ? 1 : 0, new string[] { "Light", "Dark" }, + 2, EditorStyles.miniButton) == 1; + + GUILayout.FlexibleSpace(); + } + + GUILayout.Space(10); + + using (new GUILayout.VerticalScope()) + { + var s = $"Size: {iconSelected.image.width}x{iconSelected.image.height}"; + s += "\nIs Pro Skin Icon: " + (iconSelected.tooltip.IndexOf("d_") == 0 ? "Yes" : "No"); + s += $"\nTotal {iconContentListAll.Count} icons"; + GUILayout.Space(5); + EditorGUILayout.HelpBox(s, MessageType.None); + GUILayout.Space(5); + EditorGUILayout.TextField("EditorGUIUtility.IconContent(\"" + iconSelected.tooltip + "\")"); + GUILayout.Space(5); + if (GUILayout.Button("Copy to clipboard", EditorStyles.miniButton)) + EditorGUIUtility.systemCopyBuffer = iconSelected.tooltip; + if (GUILayout.Button("Save icon to file ...", EditorStyles.miniButton)) + SaveIcon(iconSelected.tooltip); + } + + GUILayout.Space(10); + + if (GUILayout.Button("X", GUILayout.ExpandHeight(true))) + { + iconSelected = null; + } - if (GUILayout.Button( "X", GUILayout.ExpandHeight(true))) - { - iconSelected = null; } + } + static GUIContent iconSelected; + static GUIStyle iconBtnStyle = null; + static List iconContentListAll; + static List iconContentListSmall; + static List iconContentListBig; + static List iconMissingNames; + static GUIStyle iconButtonStyle = null; + static GUIStyle iconPreviewBlack = null; + static GUIStyle iconPreviewWhite = null; + + void AllTheTEXTURES(ref GUIStyle s, Texture2D t) + { + s.hover.background = s.onHover.background = s.focused.background = s.onFocused.background = s.active.background = s.onActive.background = s.normal.background = s.onNormal.background = t; + s.hover.scaledBackgrounds = s.onHover.scaledBackgrounds = s.focused.scaledBackgrounds = s.onFocused.scaledBackgrounds = s.active.scaledBackgrounds = s.onActive.scaledBackgrounds = s.normal.scaledBackgrounds = s.onNormal.scaledBackgrounds = new Texture2D[] { t }; } - } - static GUIContent iconSelected; - static GUIStyle iconBtnStyle = null; - static List iconContentListAll; - static List iconContentListSmall; - static List iconContentListBig; - static List iconMissingNames; - static GUIStyle iconButtonStyle = null; - static GUIStyle iconPreviewBlack = null; - static GUIStyle iconPreviewWhite = null; - - void AllTheTEXTURES( ref GUIStyle s, Texture2D t ) - { - s.hover.background = s.onHover.background = s.focused.background = s.onFocused.background = s.active.background = s.onActive.background = s.normal.background = s.onNormal.background = t; - s.hover.scaledBackgrounds = s.onHover.scaledBackgrounds = s.focused.scaledBackgrounds = s.onFocused.scaledBackgrounds = s.active.scaledBackgrounds = s.onActive.scaledBackgrounds = s.normal.scaledBackgrounds = s.onNormal.scaledBackgrounds = new Texture2D[] { t }; - } + Texture2D Texture2DPixel(Color c) + { + Texture2D t = new Texture2D(1, 1); + t.SetPixel(0, 0, c); + t.Apply(); + return t; + } - Texture2D Texture2DPixel( Color c ) - { - Texture2D t = new Texture2D(1,1); - t.SetPixel(0, 0, c); - t.Apply(); - return t; - } + void InitIcons() + { + if (iconContentListSmall != null) return; - void InitIcons() - { - if( iconContentListSmall != null ) return; + iconButtonStyle = new GUIStyle(EditorStyles.miniButton); + iconButtonStyle.margin = new RectOffset(0, 0, 0, 0); + iconButtonStyle.fixedHeight = 0; - iconButtonStyle = new GUIStyle( EditorStyles.miniButton ); - iconButtonStyle.margin = new RectOffset(0,0,0,0); - iconButtonStyle.fixedHeight = 0; + iconPreviewBlack = new GUIStyle(iconButtonStyle); + AllTheTEXTURES(ref iconPreviewBlack, Texture2DPixel(new Color(0.15f, 0.15f, 0.15f))); - iconPreviewBlack = new GUIStyle(iconButtonStyle); - AllTheTEXTURES( ref iconPreviewBlack, Texture2DPixel(new Color(0.15f,0.15f,0.15f))); - - iconPreviewWhite = new GUIStyle(iconButtonStyle); - AllTheTEXTURES( ref iconPreviewWhite, Texture2DPixel(new Color(0.85f, 0.85f, 0.85f))); + iconPreviewWhite = new GUIStyle(iconButtonStyle); + AllTheTEXTURES(ref iconPreviewWhite, Texture2DPixel(new Color(0.85f, 0.85f, 0.85f))); - iconMissingNames = new List(); - iconContentListSmall = new List(); - iconContentListBig = new List(); - iconContentListAll = new List(); + iconMissingNames = new List(); + iconContentListSmall = new List(); + iconContentListBig = new List(); + iconContentListAll = new List(); - for (var i = 0; i < ico_list.Length; ++i) - { - GUIContent ico = GetIcon( ico_list[ i ] ); - - if( ico == null ) + for (var i = 0; i < ico_list.Length; ++i) { - iconMissingNames.Add(ico_list[i]); - continue; - } + GUIContent ico = GetIcon(ico_list[i]); + + if (ico == null) + { + iconMissingNames.Add(ico_list[i]); + continue; + } + + ico.tooltip = ico_list[i]; - ico.tooltip = ico_list[i]; + iconContentListAll.Add(ico); - iconContentListAll.Add(ico); - - if ( !( ico.image.width <= 36 || ico.image.height <= 36 ) ) - iconContentListBig.Add(ico); - else iconContentListSmall.Add(ico); + if (!(ico.image.width <= 36 || ico.image.height <= 36)) + iconContentListBig.Add(ico); + else iconContentListSmall.Add(ico); + } } - } - // https://gist.github.com/MattRix/c1f7840ae2419d8eb2ec0695448d4321 - // https://unitylist.com/p/5c3/Unity-editor-icons + // https://gist.github.com/MattRix/c1f7840ae2419d8eb2ec0695448d4321 + // https://unitylist.com/p/5c3/Unity-editor-icons - #region ICONS + #region ICONS - public static string[] ico_list = - { + public static string[] ico_list = + { "_Help","_Popup","aboutwindow.mainheader","ageialogo","AlphabeticalSorting","Animation.AddEvent", "Animation.AddKeyframe","Animation.EventMarker","Animation.FirstKey","Animation.LastKey", "Animation.NextKey","Animation.Play","Animation.PrevKey","Animation.Record","Animation.SequencerLink", @@ -677,6 +680,7 @@ void InitIcons() "BuildSettings.SamsungTV" }; - #endregion + #endregion + } } #endif \ No newline at end of file diff --git a/Editor/EditorIcons.cs.meta b/Editor/EditorIcons.cs.meta new file mode 100644 index 0000000..24ed1c8 --- /dev/null +++ b/Editor/EditorIcons.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8751888de22e0d4c898463c81647ca0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/preview-tall.png b/Editor/preview-tall.png similarity index 100% rename from preview-tall.png rename to Editor/preview-tall.png diff --git a/Editor/preview-tall.png.meta b/Editor/preview-tall.png.meta new file mode 100644 index 0000000..814b9a6 --- /dev/null +++ b/Editor/preview-tall.png.meta @@ -0,0 +1,96 @@ +fileFormatVersion: 2 +guid: c6dac8c5fbe485749bd3ee215500821c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/preview.png b/Editor/preview.png similarity index 100% rename from preview.png rename to Editor/preview.png diff --git a/Editor/preview.png.meta b/Editor/preview.png.meta new file mode 100644 index 0000000..826123a --- /dev/null +++ b/Editor/preview.png.meta @@ -0,0 +1,96 @@ +fileFormatVersion: 2 +guid: f19fc35cc79a1954cb9514b87f94a19f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..0b78966 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b591356b3569c344abe86f12010ea0f0 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..c6f78eb --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "com.halak.unity-editor-icons", + "version": "1.0.0", + "displayName": "Unity Editor Icons", + "description": "Allows you to browse the Unity Editor icons.", + "unity": "2020.3", + "hideInEditor": true, + "author": { + "name": "halak", + "url": "https://github.com/halak" + } +} \ No newline at end of file diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..7acd4e6 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 279e59d141fa00046929295e351ccaa9 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From b95141a3820d9d29057f30154147855de7b4c4cb Mon Sep 17 00:00:00 2001 From: Palkia <4palkia4@gmail.com> Date: Fri, 3 Dec 2021 00:40:37 +0200 Subject: [PATCH 2/6] fixed author name --- Editor.meta | 2 +- Editor/EditorIcons.asmdef | 2 +- Editor/EditorIcons.asmdef.meta | 2 +- Editor/EditorIcons.cs | 2 +- Editor/EditorIcons.cs.meta | 2 +- Editor/preview-tall.png.meta | 2 +- Editor/preview.png.meta | 2 +- README.md.meta | 2 +- package.json | 6 +++--- package.json.meta | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Editor.meta b/Editor.meta index 995d8ad..3447075 100644 --- a/Editor.meta +++ b/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d61a0f05a9ff0bb4cb0fac6830679a91 +guid: dc7f4ea85ccc09a4aad05344a095a23f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Editor/EditorIcons.asmdef b/Editor/EditorIcons.asmdef index 644a9a8..969ff79 100644 --- a/Editor/EditorIcons.asmdef +++ b/Editor/EditorIcons.asmdef @@ -1,6 +1,6 @@ { "name": "EditorIcons", - "rootNamespace": "Halak.EditorIcons", + "rootNamespace": "Nukadelic.EditorIcons", "references": [], "includePlatforms": [], "excludePlatforms": [], diff --git a/Editor/EditorIcons.asmdef.meta b/Editor/EditorIcons.asmdef.meta index 53f7c87..82c6874 100644 --- a/Editor/EditorIcons.asmdef.meta +++ b/Editor/EditorIcons.asmdef.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0b84845740e8bb04c902c3ca2d91adae +guid: 66cea2cfd224be844a70f8d3a9a848e4 AssemblyDefinitionImporter: externalObjects: {} userData: diff --git a/Editor/EditorIcons.cs b/Editor/EditorIcons.cs index 7da834f..fa8e99f 100644 --- a/Editor/EditorIcons.cs +++ b/Editor/EditorIcons.cs @@ -6,7 +6,7 @@ using System.Linq; using System.IO; -namespace Halak.EditorIcons +namespace Nukadelic.EditorIcons { public class EditorIcons : EditorWindow { diff --git a/Editor/EditorIcons.cs.meta b/Editor/EditorIcons.cs.meta index 24ed1c8..f13d2dc 100644 --- a/Editor/EditorIcons.cs.meta +++ b/Editor/EditorIcons.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b8751888de22e0d4c898463c81647ca0 +guid: 65cd450af4aa1c94a831587e8d82c740 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Editor/preview-tall.png.meta b/Editor/preview-tall.png.meta index 814b9a6..5967d3b 100644 --- a/Editor/preview-tall.png.meta +++ b/Editor/preview-tall.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c6dac8c5fbe485749bd3ee215500821c +guid: bd56419f027939b4985bcc3d11f5ef06 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Editor/preview.png.meta b/Editor/preview.png.meta index 826123a..81075ee 100644 --- a/Editor/preview.png.meta +++ b/Editor/preview.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f19fc35cc79a1954cb9514b87f94a19f +guid: b945678b1a040a945ade5a0ebb3ed03b TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/README.md.meta b/README.md.meta index 0b78966..d289f36 100644 --- a/README.md.meta +++ b/README.md.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b591356b3569c344abe86f12010ea0f0 +guid: 0593c43f09f3b544aa6540e3a44ca8c3 TextScriptImporter: externalObjects: {} userData: diff --git a/package.json b/package.json index c6f78eb..2af2655 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "com.halak.unity-editor-icons", + "name": "com.nukadelic.unity-editor-icons", "version": "1.0.0", "displayName": "Unity Editor Icons", "description": "Allows you to browse the Unity Editor icons.", "unity": "2020.3", "hideInEditor": true, "author": { - "name": "halak", - "url": "https://github.com/halak" + "name": "nukadelic", + "url": "https://github.com/nukadelic" } } \ No newline at end of file diff --git a/package.json.meta b/package.json.meta index 7acd4e6..aac427c 100644 --- a/package.json.meta +++ b/package.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 279e59d141fa00046929295e351ccaa9 +guid: a81fd55bf76509243993135888318792 TextScriptImporter: externalObjects: {} userData: From 1b2f2ffac6650baf72e22e38dc2e80a927bb9416 Mon Sep 17 00:00:00 2001 From: Palkia <4palkia4@gmail.com> Date: Wed, 22 Dec 2021 00:54:12 +0200 Subject: [PATCH 3/6] disabled AutoReferenced --- Editor/EditorIcons.asmdef | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Editor/EditorIcons.asmdef b/Editor/EditorIcons.asmdef index 969ff79..291e956 100644 --- a/Editor/EditorIcons.asmdef +++ b/Editor/EditorIcons.asmdef @@ -2,12 +2,14 @@ "name": "EditorIcons", "rootNamespace": "Nukadelic.EditorIcons", "references": [], - "includePlatforms": [], + "includePlatforms": [ + "Editor" + ], "excludePlatforms": [], "allowUnsafeCode": false, "overrideReferences": false, "precompiledReferences": [], - "autoReferenced": true, + "autoReferenced": false, "defineConstraints": [], "versionDefines": [], "noEngineReferences": false From 638161f574d6002d3b770762bcc7645bdcb429b9 Mon Sep 17 00:00:00 2001 From: Palkia <4palkia4@gmail.com> Date: Wed, 22 Dec 2021 00:55:53 +0200 Subject: [PATCH 4/6] updated version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2af2655..a3769ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.nukadelic.unity-editor-icons", - "version": "1.0.0", + "version": "1.0.1", "displayName": "Unity Editor Icons", "description": "Allows you to browse the Unity Editor icons.", "unity": "2020.3", From 8e0b69722736dc4ccf4901a4c0b14270264b6297 Mon Sep 17 00:00:00 2001 From: Palkia <4palkia4@gmail.com> Date: Mon, 3 Jan 2022 16:15:15 +0200 Subject: [PATCH 5/6] changed override references to true --- Editor/EditorIcons.asmdef | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Editor/EditorIcons.asmdef b/Editor/EditorIcons.asmdef index 291e956..4fd9998 100644 --- a/Editor/EditorIcons.asmdef +++ b/Editor/EditorIcons.asmdef @@ -7,7 +7,7 @@ ], "excludePlatforms": [], "allowUnsafeCode": false, - "overrideReferences": false, + "overrideReferences": true, "precompiledReferences": [], "autoReferenced": false, "defineConstraints": [], diff --git a/package.json b/package.json index a3769ba..a0e7dba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.nukadelic.unity-editor-icons", - "version": "1.0.1", + "version": "1.0.2", "displayName": "Unity Editor Icons", "description": "Allows you to browse the Unity Editor icons.", "unity": "2020.3", From 6a7acda19ac5145aa92321111d02cace48946448 Mon Sep 17 00:00:00 2001 From: Palkia <4palkia4@gmail.com> Date: Thu, 24 Feb 2022 21:45:38 +0200 Subject: [PATCH 6/6] open save icon in current project by default --- Editor/EditorIcons.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Editor/EditorIcons.cs b/Editor/EditorIcons.cs index fa8e99f..d84cbb2 100644 --- a/Editor/EditorIcons.cs +++ b/Editor/EditorIcons.cs @@ -61,10 +61,9 @@ void SaveIcon(string icon_name) if (tex != null) { - string path = EditorUtility.SaveFilePanel( - "Save icon", "", icon_name, "png"); + string path = EditorUtility.SaveFilePanel("Save icon", Application.dataPath, icon_name, "png"); - if (path != null) + if (!string.IsNullOrWhiteSpace(path)) { try {