Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 160bd8c

Browse files
committed
Fix dark mode in development mode
1 parent 9609f31 commit 160bd8c

File tree

1 file changed

+5
-7
lines changed
  • src/UnityExtension/Assets/Editor/GitHub.Unity/Misc

1 file changed

+5
-7
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Utility.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ public static Texture2D GetIcon(string filename, string filename2x = "", bool in
3737
Texture2D texture2D = null;
3838

3939
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("GitHub.Unity.IconsAndLogos." + filename);
40-
if (stream != null)
40+
if (stream == null)
4141
{
42-
texture2D = stream.ToTexture2D();
43-
}
44-
else
45-
{
46-
var iconPath = "Assets/Editor/GitHub.Unity/IconsAndLogos/" + filename;
47-
texture2D = AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
42+
stream = new MemoryStream(Application.dataPath.ToNPath().Combine("Editor/GitHub.Unity/IconsAndLogos/", filename).ReadAllBytes());
4843
}
4944

45+
texture2D = stream.ToTexture2D();
46+
stream.Dispose();
47+
5048
if (texture2D != null)
5149
{
5250
texture2D.hideFlags = HideFlags.HideAndDontSave;

0 commit comments

Comments
 (0)