Class AssetUtils
Util functions related to loading assets at runtime.
Inherited Members
Namespace: Jotunn.Utils
Assembly: Jotunn.dll
Syntax
public static class AssetUtils
Fields
| Name | Description |
|---|---|
| AssetBundlePathSeparator | Path separator for AssetBundles |
Methods
| Name | Description |
|---|---|
| DuplicateSprite(Sprite) | Creates a readable copy of a Sprite. |
| DuplicateTexture(Sprite) | Creates a readable copy of a Sprite's texture region.
If the sprite is part of an atlas, only its texture rectangle is copied. Use AssetUtils.DuplicateTexture(sprite.texture) to copy the full texture. |
| DuplicateTexture(Texture2D) | Creates a readable copy of a Texture2D. |
| DuplicateTexture(Texture2D, Rect) | Creates a readable copy of a rectangular region from a Texture2D. |
| LoadAssetBundle(string) | Loads an asset bundle at runtime. |
| LoadAssetBundleFromResources(string) | Load an assembly-embedded AssetBundle. The calling assembly is automatically detected. |
| LoadAssetBundleFromResources(string, Assembly) | Load an assembly-embedded AssetBundle. Use this if the automatic detection of the assembly fails. |
| LoadImage(byte[]) | Wrapper for https://docs.unity3d.com/ScriptReference/ImageConversion.LoadImage.html, creates a new Texture2D. |
| LoadImage(Texture2D, byte[]) | Wrapper for https://docs.unity3d.com/ScriptReference/ImageConversion.LoadImage.html. |
| LoadMesh(string) | Loads a mesh from a .obj file at runtime. |
| LoadSprite(string) | Loads a Sprite from a file path or an asset bundle (separated by AssetBundlePathSeparator) |
| LoadSpriteFromFile(string) | Loads a Sprite from file at runtime. |
| LoadSpriteFromFile(string, Vector2) | Loads a Sprite from file at runtime. |
| LoadText(string) | Loads the contents of a file as a char string |
| LoadTextFromResources(string) | Load an assembly-embedded file as a string. The calling assembly is automatically detected. |
| LoadTextFromResources(string, Assembly) | Load an assembly-embedded file as a string. Use this if the automatic detection of the assembly fails. |
| LoadTexture(string, bool) | Loads a Texture2D from file at runtime. |