mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Initial commit
This commit is contained in:
commit
3c7cc0c973
8391 changed files with 704313 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.U2D.Animation
|
||||
{
|
||||
internal static class IconUtility
|
||||
{
|
||||
static public readonly string k_LightIconResourcePath = "SkinningModule/Icons/Light";
|
||||
static public readonly string k_DarkIconResourcePath = "SkinningModule/Icons/Dark";
|
||||
static public readonly string k_SelectedResourceIconPath = "SkinningModule/Icons/Selected";
|
||||
|
||||
public static Texture2D LoadIconResource(string name, string personalPath, string proPath)
|
||||
{
|
||||
string iconPath = "";
|
||||
|
||||
if (EditorGUIUtility.isProSkin && !string.IsNullOrEmpty(proPath))
|
||||
iconPath = Path.Combine(proPath, "d_" + name);
|
||||
else
|
||||
iconPath = Path.Combine(personalPath, name);
|
||||
if (EditorGUIUtility.pixelsPerPoint > 1.0f)
|
||||
{
|
||||
var icon2x = ResourceLoader.Load<Texture2D>(iconPath + "@2x.png");
|
||||
if (icon2x != null)
|
||||
return icon2x;
|
||||
}
|
||||
|
||||
return ResourceLoader.Load<Texture2D>(iconPath+".png");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue