bool CacheToDisk { get; set; }

robot_2Generated
code_blocksInput

Description

The CacheToDisk property of the ResourceGenerator class determines whether the generated resource should be stored on disk. When set to true, the resource generation process will create a physical file on the disk. This is particularly useful in scenarios where the resource creation is time-consuming, or when the generator will not be included in the final game distribution, or if the resource depends on data that will not be available in the shipped game.

Usage

To use the CacheToDisk property, simply set it to true or false depending on whether you want the generated resource to be cached to disk. This property is virtual, allowing derived classes to override its behavior if necessary.

Example

// Example of setting the CacheToDisk property
var resourceGenerator = new MyResourceGenerator();
resourceGenerator.CacheToDisk = true; // Enable caching to disk

// Proceed with resource generation
resourceGenerator.Generate();