build Constructors 1

functions Methods 12

AddCompiledReference (path)
Another asset's compiled output this compile reads, by the path of its source (a texture whose pixels are copied, a model whose skeleton is used), before reading it. A content build compiles that asset first and rebuilds this one when it changes. Declare every one even while Sandbox.Resources.ResourceCompileContext.Describing.
AddCompileReference (path, optional)
Add a reference that is needed to compile this resource, but isn't actually needed once compiled. Optional references may not exist - the compile won't fail without them, but if the file is created or modified later we'll recompile.
AddGameFileReference (path)
Add a game file reference. This file will be included in packages but is not a native resource. Use this for arbitrary data files that are loaded by managed code (e.g. navdata files).
AddRuntimeReference (path)
Add a reference. This means that the resource we're compiling depends on this resource.
CreateChild (absolutePath)
Child
Create a child resource
ReadMeta ()
JsonObject
The asset's .meta file as json, or null if it doesn't have one.
ReadSource ()
Byte[]
Read the source, either from in memory, or from disk
ReadSourceAsJson ()
JsonObject
Read the source, either from in memory, or from disk
ReadSourceAsString ()
string
Read the source, either from in memory, or from disk
ScanJson (json)
string
Load the json and scan it for paths or any embedded resources
WriteBlock (blockName, data)
WriteBlockJson (blockName, obj)
Serialize an object to json and write it to a named block in the compiled resource. Read it back at runtime in Sandbox.Resource.OnLoaded(Sandbox.ResourceLoadContext).
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.