1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 02:53:29 +08:00

donet format

This commit is contained in:
2025-09-21 15:38:03 +08:00
parent 5f37b8b6d6
commit a25f74443d
32 changed files with 170 additions and 155 deletions

View File

@@ -36,13 +36,13 @@ public static class Util
tex.LoadImage(fileData);
return tex;
}
public static Sprite LoadSprite(string path)
{
var tex = LoadTexture(path);
return Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
}
public static Texture2D LoadEmbeddedTexture(string path, Assembly assembly = null)
{
var fileData = LoadEmbeddedResource(path, assembly);
@@ -50,12 +50,12 @@ public static class Util
tex.LoadImage(fileData);
return tex;
}
public static Sprite LoadEmbeddedSprite(string path, Assembly assembly = null)
{
var tex = LoadEmbeddedTexture(path, assembly);
return Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
}
public static string PluginFolder(Assembly assembly = null) => Path.GetDirectoryName((assembly == null ? Assembly.GetCallingAssembly() : assembly).Location);
}