Skip to content

Class AudityNodeRegistry

The node-def registry: the package’s own defs register together at first access, and any other def registers the first time an authoring node asks DarkEffekt.Audity.AudityNodeRegistry.KindOf%60%601 for its kind. Player builds keep every node type the project’s graphs use. DarkEffekt.Audity.AudityNodeRegistry.Register%60%601 and DarkEffekt.Audity.AudityNodeRegistry.RegisterAssembly(System.Reflection.Assembly) register ahead of use. Each def is assigned a kind id (session-only - programs are transient, assets serialize node classes, not ids) and its exec is compiled into a Burst function-pointer table the realtime executor dispatches through. Registration is main-thread and idempotent; the audio thread only ever reads finished table slots.

Declaration
[BurstCompile]
public static class AudityNodeRegistry

All registered defs (index = kind id; null entries are unused ids).

Declaration
public static IReadOnlyList<AudityNodeDef> Defs { get; }

Kind ids are a byte; the table is fixed-size and never reallocates.

Declaration
public const int MaxKinds = 256

The def for a kind, or null when nothing is registered under it.

Declaration
public static AudityNodeDef Get(AudityNodeKindId kind)

DarkEffekt.Audity.AudityNodeDef

Type Name
DarkEffekt.Audity.AudityNodeKindId kind

Display name by raw kind index - the companion to DarkEffekt.Audity.AudityTelemetry.ISink.OnTiming(System.Int32%2cSystem.Int32%2cSystem.Int32%2cSystem.Int64%2cSystem.Int32), whose rows carry the index (public so player-build telemetry sinks can label their rows).

Declaration
public static string DisplayNameForIndex(int index)

System.String

Type Name
System.Int32 index

The kind id assigned to a def class, registering the def on first use. This is how an authoring node names its kind, and the new() constraint is what keeps the def in a trimmed player wherever the node is kept.

Declaration
public static AudityNodeKindId KindOf<TDef>() where TDef : AudityNodeDef, new()

DarkEffekt.Audity.AudityNodeKindId

  • TDef

Registers one def class ahead of its first use. Idempotent.

Declaration
public static void Register<TDef>() where TDef : AudityNodeDef, new()
  • TDef

Registers every concrete [AudityNode] DarkEffekt.Audity.AudityNodeDef class in assembly - “everything in my assembly” in one call, e.g. AudityNodeRegistry.RegisterAssembly(typeof(MyNodeDef).Assembly). Idempotent per def; safe to call from several bootstraps.

Declaration
public static void RegisterAssembly(Assembly assembly)
Type Name
System.Reflection.Assembly assembly
Declaration
public static void EnsureInitialized()