API ReferenceSandbox.Resources

ResourceCompilerclass

Takes the "source" of a resource and creates a compiled version. The compiled version can create a number of child resources and store binary data.

objectResourceCompiler
Namespace
Sandbox.Resources
Assembly
Sandbox.Engine
Declaration
public abstract class Sandbox.Resources.ResourceCompiler

Constructors1

Showing 1 constructors

Methods6

Showing 6 methods

protected virtual System.Threading.Tasks.Task`1<bool> Compile()PROTECTEDVIRTUAL

Returns:Task<bool>

protected bool CompileEmbeddedResource(Sandbox.Resources.EmbeddedResource embed, string subfolder, string extension, Sandbox.BaseFileSystem fs)PROTECTED

Generic method to compile an embedded resource by creating a child context. This handles the common pattern of creating a generator, generating a path, creating a child context, and setting the compiled path.

ParameterTypeDescription
embedEmbeddedResource
subfolderstring
extensionstring
fsBaseFileSystem
Returns:bool

protected string CreateGeneratedResourcePath(Sandbox.Resources.EmbeddedResource embed, string subfolder, string extension)PROTECTED

Create a deterministic path for a generated resource based on the embedded resource data.

ParameterTypeDescription
embedEmbeddedResource
subfolderstring
extensionstring
Returns:string

protected bool TryParseEmbeddedResource(System.Nullable`1<Sandbox.Resources.EmbeddedResource> resource)PROTECTED

ParameterTypeDescription
resourceNullable<EmbeddedResource>
Returns:bool

protected System.Threading.Tasks.Task`1<bool> WriteToJson()PROTECTED

Writes resource to a JSON file, using the ResourceGenerator to create the resource.

Returns:Task<bool>

Properties1

Showing 1 properties

On this page