A game about forced loneliness, made by TACStudios
at master 29 lines 936 B view raw
1using System.IO; 2using UnityEngine; 3 4namespace UnityEditor.U2D.Animation 5{ 6 internal static class EditorIconUtility 7 { 8 public const string LightIconPath = "EditorIcons/Light"; 9 public const string DarkIconPath = "EditorIcons/Dark"; 10 11 public static Texture2D LoadIconResource(string name, string lightPath, string darkPath) 12 { 13 var iconPath = ""; 14 15 if (EditorGUIUtility.isProSkin && !string.IsNullOrEmpty(darkPath)) 16 iconPath = Path.Combine(darkPath, "d_" + name); 17 else 18 iconPath = Path.Combine(lightPath, name); 19 if (EditorGUIUtility.pixelsPerPoint > 1.0f) 20 { 21 var icon2x = ResourceLoader.Load<Texture2D>(iconPath + "@2x.png"); 22 if (icon2x != null) 23 return icon2x; 24 } 25 26 return ResourceLoader.Load<Texture2D>(iconPath+".png"); 27 } 28 } 29}