class ResourceGenerator

book_4_sparkGenerated
code_blocksInput

Description

The ResourceGenerator class in the Sandbox.Resources namespace is an abstract class designed to create resources from JSON definitions. It provides methods to generate resources and manage their caching and serialization.

Members

Static Methods

Member NameSummary
Create(string generatorName)Creates a new resource generator with the specified name.
Create(EmbeddedResource serialized)Creates a resource generator from a serialized embedded resource.
CreateResource(EmbeddedResource obj, Options options)Generates a resource from an embedded resource using specified options.

Instance Methods

Member NameSummary
Deserialize(JsonObject obj)Deserializes the resource generator from a JSON object.
GetHash()Returns a hash used for loading/saving to determine if the resource has changed. By default, it serializes the generator to a JSON string and returns the CRC64 of that value.

Properties

Member NameSummary
CacheToDiskIf true, the generation will create a real resource and store it on disk. Useful if creating the resource is time-consuming or relies on data unavailable in the shipped game.