logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class RequiredReferenceAttribute

    Marks a field as a required reference and declares what happens at runtime when it is left empty, so Inspector tooling can surface an appropriately alarming status instead of staying silent.
    Pure metadata with no Unity dependency; it has no effect at runtime — the annotated field keeps its ordinary behavior.
    Deliberately restricted to fields (unlike its sibling reference attributes) because it describes serialized Inspector fields, which are never properties or parameters.

    Inheritance
    object
    Attribute
    RequiredReferenceAttribute
    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.Global.Application.Attributes
    Assembly: Serenity.Global.Application.dll
    Syntax
    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
    public sealed class RequiredReferenceAttribute : Attribute, _Attribute

    Constructors

    RequiredReferenceAttribute(RequirementSeverity)

    Creates the attribute with the given severity and no subsystem description.

    Declaration
    public RequiredReferenceAttribute(RequirementSeverity severity)
    Parameters
    Type Name Description
    RequirementSeverity severity

    How critical the field is.

    RequiredReferenceAttribute(RequirementSeverity, string)

    Creates the attribute with the given severity and subsystem description.

    Declaration
    public RequiredReferenceAttribute(RequirementSeverity severity, string subsystemDescription)
    Parameters
    Type Name Description
    RequirementSeverity severity

    How critical the field is.

    string subsystemDescription

    What stops working when the field is left null.

    Properties

    Severity

    How critical the field is: throws at boot, disables a subsystem, or purely optional.

    Declaration
    public RequirementSeverity Severity { get; }
    Property Value
    Type Description
    RequirementSeverity

    SubsystemDescription

    What stops working when the field is left null, shown to explain a RequiredSubsystemDisabled status. May be null or empty for RequiredThrowsAtBoot and Optional cases, where it is not needed.

    Declaration
    public string SubsystemDescription { get; }
    Property Value
    Type Description
    string

    Implements

    _Attribute
    In this article
    © 2026 Serenity. All Rights Reserved