Unity and NetPrints: what is known
Date: 2026-10-14. Unity is not built yet; "NetPrintsUnity" is an owner-approved roadmap candidate (2026-09-25). This note collects what the repo and earlier research already say, and no new research was done for it. Unity is the thinnest of the engine notes: the facts are few, and most of what NetPrints would do is inferred.
Tags: [V] verified (a URL or a repo file), [I] inferred. The roadmap is .specify/memory/roadmap.md in the repository (not part
of the website); lines cited are as of d3f65b8e.
1. What is known
1.1 The roadmap candidate
The roadmap entry "NetPrintsUnity" (.specify/memory/roadmap.md, near line 930) [V] describes:
- A UPM package whose
ScriptedImporterorAssetPostprocessorgenerates the.g.csnext to each.netpc.json. Unity does not compile through a csproj, soNetPrints.Sdkdoes not apply. - A
unitycatalog profile overUnityEngine.dllandLibrary/ScriptAssemblies. - Emitters for
MonoBehaviour,ScriptableObject,[SerializeField]and[RequireComponent]. - Entry points
Awake,Start,UpdateandOnCollision*. - Latent nodes as coroutines or, in Unity 6,
Awaitable. - An
ICSharpTargetProviderfor the C# target (ADR-0038), because Unity has no MSBuild evaluation: C# 9, noIsExternalInitunless the project defines one, no covariant returns. - "P1 extension points and project profiles should keep this case in mind."
The roadmap's run-profile note (near line 257) also says a public AddRunProfileKind is added when U3 or NetPrintsUnity needs it [V].
1.2 The C# compiler Unity uses
Unity manual, "C# compiler" (https://docs.unity3d.com/6000.2/Documentation/Manual/csharp-compiler.html, fetched 2026-10-14) [V]:
- Supported C# version: C# 9.0, with Roslyn as the compiler.
- Unsupported C# 9.0 features, as listed on that page: suppress emitting
localsinitflag; covariant return types; module initializers; extensible calling conventions for unmanaged function pointers; init-only setters. System.Runtime.CompilerServices.IsExternalInitis needed for complete record functionality, but exists only in .NET 5+, which Unity does not support; developers can define the type themselves. The page also advises against records in serialized types, because Unity's serialization system does not support them.
Consequence: a language version number alone cannot describe what NetPrints may emit for Unity; "C# 9" still lacks init-only
setters and covariant returns, and records need a user-defined IsExternalInit [V, consequence per the attributes research P7, F17].
This is why ADR-0038 models a CSharpTarget of language version plus types and runtime features, not just a version.
1.3 Build and run
- Unity compiles scripts itself; there is no NetPrints build for a Unity project (the NetPrintsUnity entry: Unity does not compile through a csproj) [V roadmap; the run-profile
research and its audit M1].
NetPrints.Sdkdoes not apply, so theNetPrintsGeneratetarget path is not available [I]. - Play happens inside a running Unity editor, so running from NetPrints does not start a process the way a
ProjectorExecutableprofile does: it goes through the host channel (a message to an open editor) [V from the run-profile audit M1; I for the design]. - Unity's own docs recommend attaching an IDE to the Editor or Player for debugging [V per the run-profile report; not re-fetched].
- The Unity Hub installs editors under a versioned folder and the project's version is in
ProjectSettings/ProjectVersion.txt, so locating the editor to open is engine-specific logic that belongs in an extension [I].
1.4 Other Unity facts the earlier research recorded
- Generic attributes on Unity's Mono may have runtime issues; not verified [I]. The Unity target provider can deny the feature (ADR-0038 decision 6 and 7 give the mechanism).
- Unity Visual Scripting uses attributes only to author custom nodes; no source was found for a visual-scripting tool that lets users add arbitrary attributes to graph members (attributes research P11) [I].
- The earlier Godot showcase discarded Unity as the demo engine: a coordinator conclusion that Unity is "not standard .NET" (Mono/IL2CPP) and that a domain reload hurts Roslyn-hot-compiled blueprints [I; an opinion from that session, not verified].
2. How NetPrints would integrate
Everything below is inferred from the roadmap and the ADRs unless tagged otherwise.
- Generation. A UPM package (an importer or postprocessor inside Unity) calls the generator for each
.netpc.jsonand writes the.g.csbeside it, because there is no csproj [roadmap, V]. Whether the importer shells out to the NetPrints CLI or hosts the generator is not decided [I]. - C# target. An
ICSharpTargetProvidercontribution supplies the target (ADR-0038 decision 9: "hosts without MSBuild evaluation (Unity) get anICSharpTargetProvider"): C# 9,IsExternalInitabsent unless the project defines one, no covariant returns, and a denial for generic attributes if Mono cannot run them. The research advised deferring the interface; ADR-0038 lists it as decided and leaves its shape open, to be defined with the Unity phase [V ADR; I for the Unity values beyond the manual]. - Catalog. A
unitycatalog profile overUnityEngine.dllandLibrary/ScriptAssembliessupplies the types, so graphs see Unity's API without MSBuild [roadmap, V]. - Attributes and inspector. Unity-specific attributes (
[SerializeField],[RequireComponent], and any others) are registered by the Unity plugin as attribute descriptors with inspector sections and type editors, per ADR-0039 decision 11. Which Unity attributes to include is an open question; the roadmap names[SerializeField]and[RequireComponent]only. - Emitters and entry points.
MonoBehaviourandScriptableObjectclass emitters and theAwake,Start,UpdateandOnCollision*entry-point nodes [roadmap, V]. - Latent nodes. Coroutines (an
IEnumeratorstate machine) orAwaitableon Unity 6. Whether the target provider gates this by Unity version is open [roadmap names both; I for gating]. - Run. Play goes through the host channel to an open Unity editor, not through a profile that starts a process. ADR-0037 decision 4
leaves a public experimental
AddRunProfileKindto be added "when U3 or NetPrintsUnity needs it", shaped then: build or no build, an outcome handled without a process, and a process lifetime hint [V ADR]. A Unity extension kind that opens the editor (version file plus Hub path) is the case the audit named [V audit M1; I for the design]. - Samples. The Unity plugin can ship samples under
samples/<id>/(roadmap "Samples from remote sources", README) [V]. - Where code lives. The core and workspace stay engine-agnostic (an owner rule recorded during the Godot showcase): no Unity
names, variables or paths in
src/NetPrints.Workspaceor the core [V, owner rule].
3. Open questions
- How the UPM package invokes the generator: the CLI, a hosted generator, or a Unity-side port. Domain reload and import timing against hot compilation are unexamined.
- The shape of
ICSharpTargetProvider(the ADR leaves it open), and its exact Unity values: the manual's list is the only source, so runtime features beyond it (for example default interface members, static abstract members) are unverified for Unity. - Generic attributes on Mono: not verified.
- Whether Unity 6
Awaitableand coroutines need different emitters, and how latent nodes pick one. - The host channel for Play, and the shape of the run-kind extension point (build or no build, no process, lifetime).
- How a
unitycatalog profile readsLibrary/ScriptAssemblieswhile Unity recompiles, and which assemblies it covers. - Which Unity attributes ship (beyond
[SerializeField]and[RequireComponent]), and how Unity's serialization limits (no records in serialized types) show up as graph rules. - How NetPrints finds the project's Unity version and the editor (
ProjectSettings/ProjectVersion.txt, Hub paths per OS). - Whether
.metafiles and Unity's GUID model affect where generated files and graphs live (nothing in the sources covers it). - Which Unity versions are supported.