Class SerenitySingletonSettingsAttribute
Marks a settings type the runtime resolves to exactly ONE asset per project, through
UnitySingletonSettingsLoader / WiredOrDiscoveredSettings.Resolve. A second asset of the
type is never a second configuration — it is an asset the game silently never reads.
This is the single place that fact is stated. The creation guard that warns when a second asset is about to appear, the wizard cardinality that decides what an ambiguous target offers, and the project validator that reports which asset the runtime picks all read this attribute rather than keeping a list of their own, so a type can never be a singleton to one of them and a collection to another.
Not for a type that legitimately has one asset per configured item (a game setting, an audio clip, a
HUD, a persistence backend): those are collections, resolved by
UnityCollectionSettingsLoader, and carry no attribute.
Implements
Inherited Members
Namespace: Serenity.Shared.Attributes
Assembly: Serenity.Shared.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class SerenitySingletonSettingsAttribute : Attribute, _Attribute
Constructors
SerenitySingletonSettingsAttribute(string)
Declaration
public SerenitySingletonSettingsAttribute(string displayName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | displayName |
Properties
DisplayName
Declaration
public string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string | What one asset of this type configures, in the words a warning shows an author — "Score settings", "the Cutscene Player". Null falls back to the type's own name. |