logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    Attribute
    SerenitySingletonSettingsAttribute
    Implements
    _Attribute
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.Equals(object)
    Attribute.GetHashCode()
    Attribute.Match(object)
    Attribute.IsDefaultAttribute()
    Attribute.TypeId
    object.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    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.

    Implements

    _Attribute
    In this article
    © 2026 Serenity. All Rights Reserved