# Sandbox.Resources.ResourceCompileContext

- Kind: class
- Namespace: `Sandbox.Resources`
- Assembly: `Sandbox.Engine`
- Modifiers: abstract

## Properties

- [`AbsolutePath`](/api/Sandbox.Resources.ResourceCompileContext/AbsolutePath): The absolute path to the resource on disk
- [`Data`](/api/Sandbox.Resources.ResourceCompileContext/Data): Get the data to write to
- [`RelativePath`](/api/Sandbox.Resources.ResourceCompileContext/RelativePath): The path relative to the assets folder
- [`ResourceVersion`](/api/Sandbox.Resources.ResourceCompileContext/ResourceVersion): The resource version can be important
- [`StreamingData`](/api/Sandbox.Resources.ResourceCompileContext/StreamingData): Get the streaming data to write to

## Methods

- [`AddCompileReference`](/api/Sandbox.Resources.ResourceCompileContext/AddCompileReference): 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`](/api/Sandbox.Resources.ResourceCompileContext/AddGameFileReference): 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`](/api/Sandbox.Resources.ResourceCompileContext/AddRuntimeReference): Add a reference. This means that the resource we're compiling depends on this resource.
- [`CreateChild`](/api/Sandbox.Resources.ResourceCompileContext/CreateChild): Create a child resource
- [`ReadMeta`](/api/Sandbox.Resources.ResourceCompileContext/ReadMeta): The asset's .meta file as json, or null if it doesn't have one.
- [`ReadSource`](/api/Sandbox.Resources.ResourceCompileContext/ReadSource): Read the source, either from in memory, or from disk
- [`ReadSourceAsJson`](/api/Sandbox.Resources.ResourceCompileContext/ReadSourceAsJson): Read the source, either from in memory, or from disk
- [`ReadSourceAsString`](/api/Sandbox.Resources.ResourceCompileContext/ReadSourceAsString): Read the source, either from in memory, or from disk
- [`ScanJson`](/api/Sandbox.Resources.ResourceCompileContext/ScanJson): Load the json and scan it for paths or any embedded resources
- [`WriteBlock`](/api/Sandbox.Resources.ResourceCompileContext/WriteBlock)
- [`WriteBlockJson`](/api/Sandbox.Resources.ResourceCompileContext/WriteBlockJson): Serialize an object to json and write it to a named block in the compiled resource. Read it back at runtime in `M:Sandbox.Resource.OnLoaded(Sandbox.ResourceLoadContext)`.
