s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
ResourceGenerator
chevron_left
Classes
class
ResourceGenerator
search
Constructors
lock
ResourceGenerator
Properties
data_object
CacheToDisk
Methods
functions
Deserialize
functions
FindOrCreateObject
functions
FindOrCreateObjectAsync
functions
GetHash
Static Methods
functions
Create
functions
CreateResource
ResourceGenerator
Creates a resource from a json definition
class
Sandbox.Resources
.
abstract
Sandbox.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.