Table of Contents

Class EmbeddedResourceLoader

Namespace
S1MAPI.Utils
Assembly
S1MAPI_Mono.dll

Unified resource loading from embedded assembly resources Supports loading textures, sprites, and raw bytes from manifest resources Use this class to load your embedded GLB file for custom models.

public static class EmbeddedResourceLoader
Inheritance
EmbeddedResourceLoader
Inherited Members

Methods

ListResources(Assembly?)

List all embedded resource names in an assembly

public static string[] ListResources(Assembly? assembly = null)

Parameters

assembly Assembly

Optional assembly to check (defaults to calling assembly)

Returns

string[]

Array of resource names

LoadBytes(string, Assembly?)

Load raw bytes from an embedded resource

public static byte[]? LoadBytes(string resourceName, Assembly? assembly = null)

Parameters

resourceName string

The fully qualified resource name

assembly Assembly

Optional assembly to load from (defaults to calling assembly)

Returns

byte[]

The resource bytes, or null if not found

LoadSprite(string, Assembly?, float)

Load a sprite from an embedded resource

public static Sprite? LoadSprite(string resourceName, Assembly? assembly = null, float pixelsPerUnit = 100)

Parameters

resourceName string

The fully qualified resource name (PNG or JPG)

assembly Assembly

Optional assembly to load from (defaults to calling assembly)

pixelsPerUnit float

Pixels per unit for the sprite (default 100)

Returns

Sprite

The loaded sprite, or null if loading failed

LoadTexture(string, Assembly?)

Load a texture from an embedded resource

public static Texture2D? LoadTexture(string resourceName, Assembly? assembly = null)

Parameters

resourceName string

The fully qualified resource name (PNG or JPG)

assembly Assembly

Optional assembly to load from (defaults to calling assembly)

Returns

Texture2D

The loaded texture, or null if loading failed

ResourceExists(string, Assembly?)

Check if an embedded resource exists

public static bool ResourceExists(string resourceName, Assembly? assembly = null)

Parameters

resourceName string

The fully qualified resource name

assembly Assembly

Optional assembly to check (defaults to calling assembly)

Returns

bool

True if the resource exists, false otherwise