Resourceclass
A resource loaded in the engine, such as a `Sandbox.Model` or `Sandbox.Material`.
Constructors1
Showing 1 constructors
protected Resource()
No results match this filter.
Methods7
Showing 7 methods
public virtual void ConfigurePublishing(Sandbox.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.
| Parameter | Type | Description |
|---|---|---|
| context | ResourcePublishContext | — |
void—protected virtual Sandbox.Bitmap CreateAssetTypeIcon(int width, int height)
Create an icon for this type of asset. This is an icon that is shown in the editor.
| Parameter | Type | Description |
|---|---|---|
| width | int | — |
| height | int | — |
protected static Sandbox.Bitmap CreateSimpleAssetTypeIcon(string icon, int width, int height, System.Nullable`1<Color> background = null, System.Nullable`1<Color> foreground = null)
| Parameter | Type | Description |
|---|---|---|
| icon | string | — |
| width | int | — |
| height | int | — |
| background = null | Nullable<Color> | — |
| foreground = null | Nullable<Color> | — |
protected virtual override void Finalize()
void—public Sandbox.Bitmap GetAssetTypeIcon(int width, int height)
Get the icon for this type of asset. This is an icon that is shown in the editor.
| Parameter | Type | Description |
|---|---|---|
| width | int | — |
| height | int | — |
public virtual Sandbox.Bitmap RenderThumbnail(Sandbox.Resource.ThumbnailOptions options)
Render a thumbnail for this specific resource.
| Parameter | Type | Description |
|---|---|---|
| options | ThumbnailOptions | — |
public virtual void StateHasChanged()
Should be called after the resource has been edited by the inspector
void—No results match this filter.
Properties7
Showing 7 properties
public System.Nullable`1<Sandbox.Resources.EmbeddedResource> Sandbox.Resource.EmbeddedResource { get; set; }
Embedded data for this resource
public virtual bool Sandbox.Resource.HasUnsavedChanges { get; set; }
True if this resource has been changed but the changes aren't written to disk
bool—public virtual bool Sandbox.Resource.IsError { get; set; }
bool—public virtual bool Sandbox.Resource.IsValid { get; set; }
bool—public int Sandbox.Resource.ResourceId { get; set; }
ID of this resource,
Obsolete: ResourceId is obsolete and will be removed in the future.
int—public string Sandbox.Resource.ResourceName { get; set; }
File name of the resource without the extension.
string—public string Sandbox.Resource.ResourcePath { get; set; }
Path to this resource.
string—No results match this filter.