Class ConfigurationSlotAttribute
Marks a serialized ScyllaConfiguration field on a ScyllaModule (or the bootstrap) as a configuration slot, declaring the asset that the module requires or optionally accepts. Configuration slots define which configuration assets a module supports, how they should be auto-loaded at startup, and how they are labeled and ordered in the Inspector.
Inherited Members
Namespace: Scylla.Core.Config
Assembly: ScyllaCore.dll
Syntax
[AttributeUsage(AttributeTargets.Field)]
public sealed class ConfigurationSlotAttribute : Attribute
Remarks
Modules declare configuration slots by applying this attribute to their ScyllaConfiguration-typed serialized fields:
The Scylla Editor Inspector discovers all fields decorated with ConfigurationSlotAttribute via reflection on the module's type hierarchy. For each slot it:
- Displays the field using DisplayName (or the field name as a fallback) sorted by Order.
-
Attempts to auto-load the asset from ResourcePath via
Resources.Loadwhen the field is unassigned and the path is non-empty. -
Raises a validation error at startup when Required is
trueand no asset is assigned or found in Resources.
Constructors
ConfigurationSlotAttribute()
Initializes a new ConfigurationSlotAttribute with all default settings:
optional (Required = false), no custom display name, no auto-load
path, and sort order 0.
Declaration
public ConfigurationSlotAttribute()
ConfigurationSlotAttribute(bool, string, string, int)
Initializes a new ConfigurationSlotAttribute with the specified settings.
Declaration
public ConfigurationSlotAttribute(bool required = false, string displayName = null, string resourcePath = null, int order = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | required |
|
| string | displayName | The label to show for this slot in the Inspector. Pass |
| string | resourcePath | A |
| int | order | Sort key controlling the vertical position of this slot relative to other slots on the
same module in the Inspector. Lower values appear first. Defaults to |
Remarks
Typical module usage - a required configuration that auto-loads from Resources and appears before any optional slots:
public class MyModule : ScyllaModule
{
[ConfigurationSlot(required: true,
displayName: "My Module Config",
resourcePath: "Config/MyModuleConfiguration",
order: 0)]
[SerializeField]
private MyModuleConfiguration _configuration;
[ConfigurationSlot(required: false,
displayName: "Optional Theme",
order: 10)]
[SerializeField]
private MyThemeConfiguration _theme;
}
Properties
DisplayName
Gets the label to use for this configuration slot in the Inspector.
When null or empty the field name (converted from camelCase by Unity) is used
as the fallback label.
Declaration
public string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string | A human-readable label string, or |
Order
Gets the sort key that controls the vertical position of this slot relative to other
configuration slots on the same module in the Inspector. Slots are sorted in ascending
order, so a slot with Order = 0 appears above a slot with Order = 10.
Declaration
public int Order { get; }
Property Value
| Type | Description |
|---|---|
| int | An integer sort key; lower values appear first. Defaults to |
Required
Gets whether this configuration is required for the module to function.
When true, startup validation will produce an error and abort initialization
if no configuration asset is assigned to the field and none can be auto-loaded from
ResourcePath.
Declaration
public bool Required { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
ResourcePath
Gets the Resources-relative path (without file extension) used to auto-load this
configuration asset when the field is unassigned in the Inspector. The path must be
relative to a Resources folder, for example
"Config/Scylla Logger Configuration". When null or empty, auto-loading
is disabled and the asset must be assigned manually in the Inspector.
Declaration
public string ResourcePath { get; }
Property Value
| Type | Description |
|---|---|
| string | A |