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 serialization and caching.
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 serialization and caching.
Member Name | Summary |
---|---|
Create(String) | Creates a new resource generator with the specified name. |
Create(EmbeddedResource) | Creates a new resource generator from a serialized embedded resource. |
CreateResource | Generates a resource from an embedded resource and options. |
Member Name | Summary |
---|---|
Deserialize | Deserializes a JSON object into the resource generator. |
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. |
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. |