Loading...
Loading...
Use when structuring Unity 6.3 C# code: ScriptableObject data vs runtime state, events and services, inventory, health, save and load, Input System actions and key rebinding, async with Awaitable, assembly definitions, Enter Play Mode and domain reload, .meta files, Git, Smart Merge and LFS. Also when 'my save works in the Editor but not in the build', statics keep values on the second Play, events fire twice or never, an await runs after its object died, rebinds are lost on relaunch, a renamed class loses its data, a scene merge breaks.
npx skill4agent add scenario-labs/skills scenario-unity-architecturenpx skills add scenario-labs/skills --skill <name>ut_envut_runut_livescripts/ut_arch.pyscripts/AgentKit/Architecture/scripts/templates/tests/code/unity-architecture/run_all.sh --livearchive/tests/unity-architecture/live_results.jsonlIsDirty.assetSaveAssetsso_guardconfig.StatsExitingPlayModeSubsystemRegistrationDoublePlayDestroydestroyCancellationTokenLifetime.Linked(this)Application.exitCancellationTokenAsTask()persistentDataPathTime.timetransformnew GameObjectRaiseDebug()[DefaultExecutionOrder(-1000)]effectivePathshortcutKeysConsumeInputLoadBindingOverridesFromJsonfalseut_arch.rebind_auditnewnoEngineReferencesUnity.InputSystem.TestFrameworktestables[FormerlySerializedAs][MovedFrom][SerializeReference][Serializable][SerializeReference]-l-rGameRootpersistentDataPathArchJobs.ProjectFactsut_arch.install(P)ut_arch.scaffold(P)ArchJobs.ProjectFactsUnity -batchmode -nographics -quit -executeMethod AgentKit.Architecture.ArchJobs.ProjectFactsArchJobs.AssemblyGraphengine_refs == 0violations == []ArchJobs.CreateAssetsut_arch.item_specs()SerializedObjectmanaged_refs[SerializeReference]unchangedItemDatabaseValidatorut_run.run_tests(P, "EditMode", assemblies="Game.Tests.EditMode")ut_arch.code_lintSaveServiceCrossProcessSaveInputContextRebindFlowBindingStore.inputactionsArchInputAudit.AuditInputTestFixturemissing_schemeduplicate_bindingrebind_auditasync Awaitable Start()AsTask[UnityTest]async TaskArchJobs.StaticStateAuditArchPlayMode.DoublePlayso_guardinvokeRaiseDebugarch.static_without_resetso_changed_in_memory == []okArchJobs.SetVcsSettingsut_arch.write_vcs_filesgit_setup_unity_mergemeta_audityaml_mergeArchJobs.InspectAssetmeta_audit.ok.meta| Value | Relative to | Source |
|---|---|---|
| 11 to 13 s | one batch job on this project (editor boot included) | observed |
| about 11 s / 16 s | EditMode suite (33 tests) / PlayMode suite (17 tests), final run | observed |
| 13 to 14 ticks | token-less 0.02 s Awaitable loop in the 0.3 s after | observed |
| 2 / 2 | static counter / static event subscribers in Play session 2, domain reload off | observed |
| 4 of 6 / 0 of 6 | Unity calls that threw off the main thread in a development / release macOS player | observed |
| 0 B | heap growth over 10,000 channel raises or persistent UnityEvent invokes after warm-up | observed |
| about 37,000 to 61,000 fps | batch | observed |
| 0.05 s; false | | package source 1.20; observed |
next | Task continuation started on the main thread | 6.3 Manual |
| about 500 KB | binary size above which Git LFS pays | Pettersen 2016 |
| exit 0 / 2 | UnityYAMLMerge clean / any conflicted field (also with | observed |
| 114.7 MB / 311.2 MB | macOS Mono release / development player of a probe scene | observed |
AssemblyGraph.violations == []failed == 0code_lintso_guardSnapshotAssetschanged_on_disk == []StaticStateAuditDoublePlayArchInputAuditrebind_auditmeta_audit.okAgentCapture| Mistake | What it looks like | Fix |
|---|---|---|
| save stored in an SO | works in the Editor, lost after relaunch of the build | |
| SO guard by file hash | passes while Play writes an SO | |
| session state in an unreferenced SO | value back to baked after a scene load, in the build | keep it referenced or hold it in C# |
| statics with domain reload off | second Play starts at 2, handler runs twice | ExitingPlayMode unregister + SubsystemRegistration reset |
| await without token | logic runs after the object died or Play ended | |
| awaiting an Awaitable twice | exception or hang | |
| threads checked in a release build only | fine now, undefined later | development player smoke test (A12) |
| listeners iterated forward | a self-removing response skips the next | iterate backwards |
| composition root without execution order | a consumer's Awake finds no service | |
| rebinding an enabled action | | |
Button rebind without | Escape becomes the binding | |
| Reset All keeps the file; loads not layered | old rebinds return; earlier overrides vanish | |
| null after fixture tests; pairing breaks | |
| a generated input class per consumer | a rebind shows on one screen only | one shared instance |
| runtime asmdef references editor asmdef | Editor fine, player build fails | |
class renamed behind | entries load as null | |
| trusting a merge output | conflicted field silently back to base | check exit 2, resolve, |
RebindFlowBindingStoreInputContextRaiseDebugIDamageableHealthServicesGameRootrun_tests(..., assemblies=...).gitignore.gitattributesAgentProfileTask.DelaypersistentDataPathAutoStaticsCleanupFindObjectsByType<T>(FindObjectsSortMode.None)[SerializeField]GetInstanceIDEntityId[SerializeReference][Serializable]Input.*OnMouseDownObject.DestroyLifecycleTestsOnDisableOnDestroyreferences/procedures.mdreferences/expert-notes.mdreferences/critique.mdreferences/gui-paths.mdreferences/sources.mdscripts/ut_arch.pyscripts/AgentKit/Architecture/*.csscripts/templates/