s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
live now
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
The jam is running. Build something, or play the entries.
£
50,000
prizepool
View the jam
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
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
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.