logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SignalParameterReflection

    Reflection helpers shared by the runtime builder and the custom editor for classifying signal constructor parameters, deciding whether a complex type can be authored from the Inspector, and selecting/locating the constructor used to build it.
    Lives in the runtime assembly (no editor dependencies) so both layers behave identically.

    Inheritance
    object
    SignalParameterReflection
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.EventDispatcher.Infrastructure.Settings
    Assembly: Serenity.UnityGlobal.Infrastructure.dll
    Syntax
    public static class SignalParameterReflection

    Fields

    MaxDepth

    Maximum recursion depth when expanding nested complex parameters.

    Declaration
    public const int MaxDepth = 6
    Field Value
    Type Description
    int

    Methods

    ClassifyKind(Type)

    Classifies a parameter type (after unwrapping nullable) into a leaf kind, or Complex when it is a class/struct authorable through a constructor, or Unsupported otherwise.

    Declaration
    public static SignalParameterKind ClassifyKind(Type type)
    Parameters
    Type Name Description
    Type type

    The parameter type to classify.

    Returns
    Type Description
    SignalParameterKind

    The resolved kind.

    FindConstructor(Type, IReadOnlyList<string>)

    Finds the public instance constructor whose parameter types' AssemblyQualifiedNames match paramTypeAqns in order, or null when none match.

    Declaration
    public static ConstructorInfo FindConstructor(Type type, IReadOnlyList<string> paramTypeAqns)
    Parameters
    Type Name Description
    Type type

    The type whose constructors are searched.

    IReadOnlyList<string> paramTypeAqns

    The ordered parameter type names that identify the overload.

    Returns
    Type Description
    ConstructorInfo

    The matching constructor, or null.

    GetAuthorableConstructors(Type)

    Returns every public instance constructor of type whose parameters are all authorable, ordered by parameter count ascending. Used to let the user choose how a complex value is built (e.g. a full field-by-field constructor vs a definition-based one).

    Declaration
    public static ConstructorInfo[] GetAuthorableConstructors(Type type)
    Parameters
    Type Name Description
    Type type

    The complex type to inspect.

    Returns
    Type Description
    ConstructorInfo[]

    The authorable constructors (possibly empty).

    IsAuthorable(Type)

    Determines whether a value of the given type can be authored from the Inspector — directly (leaf) or recursively through a constructor (complex). Cycles are treated as non-authorable.

    Declaration
    public static bool IsAuthorable(Type type)
    Parameters
    Type Name Description
    Type type

    The type to test.

    Returns
    Type Description
    bool

    True when the type can be authored.

    IsLeafKind(SignalParameterKind)

    True when the kind is a directly editable leaf (not complex and not unsupported).

    Declaration
    public static bool IsLeafKind(SignalParameterKind kind)
    Parameters
    Type Name Description
    SignalParameterKind kind
    Returns
    Type Description
    bool

    PrettySignature(ConstructorInfo)

    Formats a constructor as (TypeA a, TypeB b) for display.

    Declaration
    public static string PrettySignature(ConstructorInfo ctor)
    Parameters
    Type Name Description
    ConstructorInfo ctor

    The constructor to describe.

    Returns
    Type Description
    string

    A readable signature.

    PrettyTypeName(Type)

    Returns a friendly type name for display, using C# aliases for the common primitives (e.g. float instead of Single) and a trailing ? for nullable value types.

    Declaration
    public static string PrettyTypeName(Type type)
    Parameters
    Type Name Description
    Type type

    The type to format.

    Returns
    Type Description
    string

    A readable type name.

    SelectBestConstructor(Type)

    Picks the public instance constructor with the most authorable parameters (the most expressive one), or null when no constructor's parameters are all authorable.

    Declaration
    public static ConstructorInfo SelectBestConstructor(Type type)
    Parameters
    Type Name Description
    Type type

    The complex type to inspect.

    Returns
    Type Description
    ConstructorInfo

    The chosen constructor, or null.

    TryUnwrapNullable(Type, out Type)

    Returns the underlying type of a Nullable<T>, or the type itself when it is not nullable, and reports whether unwrapping occurred.

    Declaration
    public static bool TryUnwrapNullable(Type type, out Type underlying)
    Parameters
    Type Name Description
    Type type

    The type to inspect.

    Type underlying

    The unwrapped (non-nullable) type.

    Returns
    Type Description
    bool

    True when type was a nullable value type.

    In this article
    © 2026 Serenity. All Rights Reserved