Api Sandbox Resource
class

Resource

public abstract class Resource

A resource loaded in the engine, such as a Model or Material.

Properties

Name Type Description
ResourceId Int32 ID of this resource,
ResourcePath String Path to this resource.
ResourceName String File name of the resource without the extension.
IsValid virtual Boolean
HasUnsavedChanges virtual Boolean True if this resource has been changed but the changes aren't written to disk
EmbeddedResource EmbeddedResource? Embedded data for this resource

Methods

Bitmap GetAssetTypeIcon(Int32 width, Int32 height)

Get the icon for this type of asset. This is an icon that is shown in the editor.

virtual Void StateHasChanged()

Should be called after the resource has been edited by the inspector

virtual Void ConfigurePublishing(ResourcePublishContext context)

When publishing an asset we'll call into this method to allow the resource to configure how it wants to be published. This allows your resource to make bespoke decisions to configure publishing based on its content.

virtual Bitmap RenderThumbnail(ThumbnailOptions options)

Render a thumbnail for this specific resource.

Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.Resource