Skip to content

Game.Debug.DebugContainerAttribute

Assembly: Assembly-CSharp
Namespace: Game.Debug

Type: class

Base: UnityEngine.Scripting.PreserveAttribute

Summary: Attribute used as a marker for classes or structs that act as debug containers in the game's debug tooling. Inherits from UnityEngine.Scripting.PreserveAttribute so annotated types are preserved from code stripping and available for reflection/inspection by runtime debug systems. This attribute does not add behavior by itself — it is a metadata marker consumed by the game's debug infrastructure.


Fields

  • None
    No private or public fields are defined on this attribute type.

Properties

  • None
    This attribute does not declare any properties beyond those inherited from its base types.

Constructors

  • public DebugContainerAttribute()
    Implicit parameterless constructor (no custom constructor is defined in source). This attribute can be instantiated by applying it to a type via the [DebugContainer] syntax.

Methods

  • None
    No methods are declared on this attribute type; it only serves as a marker and inherits any functionality from PreserveAttribute.

Usage Example

using Game.Debug;

// Mark a class used for debug display/inspection
[DebugContainer]
public class MyDebugInfo
{
    public int exampleValue;
    public string description;
}

// Or on a struct
[DebugContainer]
public struct MyDebugStruct
{
    public float x, y, z;
}

Notes: - The attribute targets classes and structs only (AttributeTargets.Class | AttributeTargets.Struct). - Because it derives from UnityEngine.Scripting.PreserveAttribute, applying [DebugContainer] helps ensure the annotated type is retained by Unity's managed code stripping and available for runtime reflection needed by debug tools.