Skip to content

Game.Debug.DebugWatchDepsAttribute

Assembly: Assembly-CSharp (game code)
Namespace: Game.Debug

Type: class

Base: System.Attribute

Summary:
A simple marker attribute that can be applied to fields to indicate they are part of the debug "watch" dependency system. The attribute itself has no behavior; it is intended to be discovered by tooling or runtime reflection (for example, the game's debug UI or editor extensions) to treat the tagged field specially (e.g., include it in dependency graphs, watch windows, or custom debugging utilities). It is targeted to fields only (AttributeTargets.Field).


Fields

  • This attribute class declares no fields.
    The source contains no instance or static fields.

Properties

  • This attribute class declares no properties.

Constructors

  • public DebugWatchDepsAttribute()
    Default parameterless constructor automatically provided by the class. The attribute has no data payload; instances are only used as markers.

Methods

  • This attribute class declares no methods.

Additional information

  • Attribute usage: [AttributeUsage(AttributeTargets.Field)] — applies only to fields, AllowMultiple is false (default), and it is not inheritable.
  • Typical consumers: editor tools, debug windows, runtime reflection code that looks for fields annotated to present or process additional debug information.

Usage Example

using Game.Debug;

public class MyDebugComponent
{
    // Mark a field so the debug watch/dependency tooling can pick it up.
    [DebugWatchDeps]
    private int someInternalValue;
}

Reflection example (runtime/tooling) to detect the attribute:

using System;
using System.Reflection;

var field = typeof(MyDebugComponent).GetField("someInternalValue", BindingFlags.NonPublic | BindingFlags.Instance);
bool hasAttr = field.IsDefined(typeof(Game.Debug.DebugWatchDepsAttribute), inherit: false);
if (hasAttr)
{
    // Handle as a debug-watched dependency
}

Notes: - Because the attribute carries no data, its presence alone signals the intent. If you need to encode metadata (priority, label, etc.), a different attribute with properties would be required. - Keep the attribute usage limited to debugging/tools code; removing it has no runtime effect unless your tooling depends on it.