s&
newspaperAbout
infoAbout s&box newspaperLatest News published_with_changesChanges mapRoadmap monitoringMetrics
gamesGames
sports_esportsBrowse Games rocketDiscover Games
business_centerWorkshop
sports_esportsGames landscapeMaps chairModels textureMaterials apparelClothing constructionMore..
forumForum docsDocs
docsDocumentation dashboardApi Reference schoolTutorials
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
Classes
ResourceGenerator
chevron_left Classes
class
ResourceGenerator

Constructors

lockResourceGenerator

Properties

data_objectCacheToDisk

Methods

functionsDeserializefunctionsFindOrCreateObjectfunctionsFindOrCreateObjectAsyncfunctionsGetHash

Static Methods

functionsCreatefunctionsCreateResource
ResourceGenerator
Creates a resource from a json definition
class Sandbox.Resources .
abstractSandbox.Engine

build Constructors 1

ResourceGenerator ()

data_object Properties 1

CacheToDisk
bool
If true then the generation will create a real resource and store it on disk. Use this if creating the resource takes a while, or you won't be shipping the generator with the game, or if it relies on data that won't be available in the shipped game.

functions Methods 4

Deserialize (obj)
Copy properties from obj to us
FindOrCreateObject (options)
Resource
Find or create the resource (blocking)
FindOrCreateObjectAsync (options, token)
ValueTask`1
If we generated this before, then find the current cache'd value. If not, then generate a new one.
GetHash ()
UInt64
Returns a hash to be used when loading/saving. We use this to determine if the resource has changed. By default we serialize the generator to a json string and return the CRC64 of that value. You can override this in your generator if you need to make it faster, or ignore some stuff.

functions Static Methods 2

Create (generatorName)
ResourceGenerator`1
Create a ResourceGenerator by name
CreateResource (obj, options)
T

Inheritance

ResourceGenerator
ResourceGenerator<T>
TextureGenerator
ColorTextureGenerator
ImageFileGenerator
LinearGradient
RadialGradient
RandomTextureGenerator
RenderTextureAssetGenerator
SvgSourceGenerator
TextTextureGenerator
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter