public static abstract sealed class Sandbox.ResourceLibrary
Keeps a library of all available `Sandbox.Resource`.
Related Guides
Broader workflow and conceptual references connected to this API.
You can define your own custom asset types as GameResources. They give you a nice inspector window and they're hotloaded in-game, which means you can whip things up pretty quickly if you're using them.
Editor Events are events that are broadcast globally throughout the editor and can be listened to/fired from any Editor Project. These are useful for creating your own custom Editor Tools and making sure they can work in tandem with existing systems.
You can define movies and play them back using C#.
s&box provides several ways to play sounds in code. You can fire-and-forget a sound at a world position, control it via a SoundHandle, attach it to a GameObject, or use scene components entirely.
You can implement the ISceneMetadata interface in any Component that has data you'd like saved to Metadata. Metadata is data that can be accessed without needing to load a Scene or clone a Prefab (accessed via either the SceneFile or PrefabFile)
Methods
Showing 7 methods
public static System.Threading.Tasks.Task`1<Sandbox.Bitmap> GetThumbnail(string path, int width = 256, int height = 256)
Render a thumbnail for this resource
Parameters
width: Default: 256height: Default: 256
public static System.Threading.Tasks.Task`1<T> LoadAsync(string path)
Load a resource by its file path.
public static bool TryGet(string filepath, T resource)
Try to get a cached resource by its file path.
Parameters
filepath: File path to the resource.resource: The retrieved resource, if any.
Returns
True if resource was retrieved successfully.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.ResourceLibrary |