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.
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.
Member Name | Summary |
---|---|
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. |
Member Name | Summary |
---|---|
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. |
Member Name | Summary |
---|---|
CacheToDisk | If 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. |