Skip to content

Commit 3f96964

Browse files
SolidAlloyxsduan
authored andcommitted
Added back HideFlags.DontSave
I overlooked that this flag was set for textures in GetColorizedTexture(). It is necessary for the texture to not be unloaded when Play Mode switches to Edit Mode.
1 parent 77e3d95 commit 3f96964

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Editor/Icons/HierarchyFolderIcon.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static class HierarchyFolderIcon
5555
public static int IconColumnCount => IconColors.GetLength(0);
5656
public static int IconRowCount => IconColors.GetLength(1);
5757

58-
public static readonly Color[,] IconColors = {
58+
private static readonly Color[,] IconColors = {
5959
{new Color(0.09f, 0.57f, 0.82f), new Color(0.05f, 0.34f, 0.48f),},
6060
{new Color(0.09f, 0.67f, 0.67f), new Color(0.05f, 0.42f, 0.42f),},
6161
{new Color(0.23f, 0.73f, 0.36f), new Color(0.15f, 0.41f, 0.22f),},
@@ -101,7 +101,8 @@ private static Texture2D GetTextureWithMaterial(Texture2D original, Material mat
101101
newTexture = new Texture2D(original.width, original.width, TextureFormat.ARGB32, false, true)
102102
{
103103
name = name,
104-
filterMode = FilterMode.Bilinear
104+
filterMode = FilterMode.Bilinear,
105+
hideFlags = HideFlags.DontSave
105106
};
106107

107108
newTexture.ReadPixels(new Rect(0.0f, 0.0f, original.width, original.width), 0, 0);
@@ -200,6 +201,7 @@ private static void RefreshFolderIcons(int instanceid, Rect selectionrect)
200201
bool isExpanded = (bool)meth_isExpanded.Invoke(data, new object[] { item });
201202

202203
var icons = ColoredFolderIcons(Mathf.Clamp(colorIndex, 0, _coloredFolderIcons.Length - 1));
204+
203205
item.icon = isExpanded ? icons.open : icons.closed;
204206

205207
prop_selectedIcon.SetValue(item, isExpanded ? _openFolderSelectedTexture : _closedFolderSelectedTexture);

0 commit comments

Comments
 (0)