codeAPI Reference
s&box IDefinitionResource: Resource metadata interface
IDefinitionResource API Reference
IDefinitionResource is an interface for game resources that have display metadata (title and description).
Type Signature
CSHARP
public interface IDefinitionResource
{
string Title { get; set; }
string Description { get; set; }
}Properties
- string Title { get; set; } - The display title of the resource.
- string Description { get; set; } - A description of the resource.
Usage
Implement this interface on GameResource classes to provide metadata for UI display:
CSHARP
public class MyCustomResource : GameResource, IDefinitionResource
{
[Property] public string Title { get; set; } = "My Resource";
[Property] public string Description { get; set; } = "A custom game resource";
}Notes
- Used by the editor and UI to display resource information.
- Properties are typically set via [Property] attributes in the inspector.
- Title and Description are shown in resource pickers and inspectors.
- Commonly used for custom asset types that need user-friendly names.
Was this helpful?