Source-linked AI summary
Unity Insight: A Production Code--Asset Index for LLM Coding Agents in Unity Projects
Shenhua Gu, Hongqiang Zhu, Fan Zhang, Jinming Zhang, Hao Chen
TL;DR
Unity’s code–asset relationships are distributed across scripts, serialized assets, and GUIDs, which makes basic cross-file questions difficult to answer with code-only retrieval. Unity Insight indexes those relationships and exposes them through typed agent-query tools. In a paired study across two Unity games, the index-backed agent used 53% fewer tokens and 52% less wall-clock time than general-purpose exploration.
Problem
Unity code–asset relationships live in serialized YAML and .meta GUIDs as well as C# scripts, so code-only search cannot answer basic cross-file questions directly.
Source: §1 · p. 1Method
Unity Insight crawls C# and serialized assets into a persistent code–asset index that agents query through typed tools.
Source: §2 · p. 1Results
53% fewer tokens and 52% less wall-clock time: the index-backed agent’s totals were lower than general-purpose exploration across 28 paired questions on two Unity games.
Source: §3 · pp. 1–2Takeaways & Limitations
Unity Insight serves as the built-in code–asset indexing layer and native navigation surface for Unity projects in production Codely.
Source: §5 · p. 2The index is a static snapshot that omits runtime and editor state, and string-based Resources.Load dynamic loads are a known extraction blind spot.
Source: §2 · p. 1
Abstract
from arXiv · showhide
LLM coding agents increasingly operate inside game-engine repositories, where application logic is inseparable from serialized assets: a single gameplay change may span C\# scripts, prefabs, scenes, and ScriptableObjects wired together by Unity GUIDs. The retrieval tools agents carry today---shell utilities and code-only indexes---cannot answer basic cross-file questions, because these relationships live in \texttt{.meta} files and YAML assets rather than in code. We present Unity Insight, to our knowledge the first persistent, LLM-facing, agent-integrated cross-file code--asset index for Unity projects, shipping in production with Tuanjie Codely, the agent CLI of Tuanjie Engine, since its public launch on 2026-07-28. In a paired experiment---28 project-specific questions on two Unity games, same model and harness, one run per arm per question---the index-backed agent spent 53\% fewer tokens and 52\% less wall-clock time than a general-purpose exploration agent (exact paired sign tests, $p{<}0.004$), using only its typed index-query tools.
1 Introduction
Unity projects distribute important code–asset relationships across C# scripts, YAML assets, and GUIDs, leaving code-only search unable to answer basic cross-file questions. Unity Insight is presented as a persistent cross-file index for LLM coding agents.
1 Introduction
- Unity scripts, YAML assets, and .meta GUIDs encode relationships that C# alone cannot answer, while manual YAML search requires costly page-by-page GUID chaining.Questions include which prefabs instantiate a script and which scene consumes a texture.Source: §1 · p. 1
- Unity Insight is a persistent cross-file code–asset index for LLM coding agents.The authors describe it as the first persistent, LLM-facing, agent-integrated index for Unity projects, to their knowledge.Source: §1 · p. 1
- Unity Insight ships with the Codely agent, and the report presents the system and initial quantitative evidence on Unity-aware hybrid indexing.The paper dates the public launch to 2026-07-28.Source: §1 · p. 1
2 Unity Insight
Unity Insight crawls C# and serialized Unity assets into a persistent graph of code–asset relationships. Agents query that read-only index through typed tools rather than manually tracing GUIDs with grep.
2 Unity Insight
- The crawler parses C# and serialized scenes, prefabs, ScriptableObjects, and importer .meta files, resolving GUID paths, component–script bindings, nested-prefab chains, and asset references.The resulting references are stored in a persistent, read-only SQLite database.Source: §2 · p. 1
- The agent queries the graph through five typed tools instead of manually chaining grep over GUIDs.The tools support listing, globbing, content search, path-addressed reads, and bidirectional reference traversal.Source: Figure 1 · p. 1, §2 · p. 1
- The index builds on demand, refreshes incrementally, is off by default, and does not mutate project files.Relationship extraction uses typed interfaces where available and regex-based extraction otherwise; the index is a static snapshot that omits runtime and editor state.Source: §2 · p. 1
3 Experimental Study
In a paired study of 28 project-specific questions across two Unity games, the index-backed agent used fewer tokens and less wall-clock time than general-purpose exploration. The study also reports per-question consistency and a concrete asset-reference example.
3 Experimental Study
- The study paired production Codely subagents on RedRunner and an internal racing game, using the same model and harness with one run per arm per question.The 28 questions covered asset and scene references, script discovery, hierarchy and prefab lookups, and multi-artifact impact analysis; index-building was outside the measured window.Source: §3 · pp. 1–2
- 53% fewer tokens and 52% less wall-clock time: the index-backed arm’s totals were lower than the exploration arm’s across 28 paired questions.Table 1 compares arm totals for one run per arm per question using the same model and harness.Source: §3 · p. 2, Table 1 · p. 2
- 23/28 questions used fewer tokens with the index, with median per-question ratios of 0.59 for tokens and 0.53 for wall clock.Sign tests also found less output on 24/28 questions (p=0.0002), less wall time on 22/28 (p=0.0037), and fewer tool calls on 21/26 (p=0.0025; two ties).Source: §3 · p. 2, Figure 2 · p. 2
- 38,901 tokens and 10.4 s: the index answered the Chest Big prefab question with three reference queries, versus 194,486 tokens and 176 s for 15 exploration file operations.Both arms found the same clip, Open at Assets/Animations/Chest Big/Open.anim; the decisive hop crossed two GUID references absent from C# code.Source: §3 · p. 2
4 Related Work
Related work spans Unity GUID-based asset analysis and repository-level agent benchmarks, but the authors report no Unity-specific benchmark to their knowledge. This gap motivates their benchmark artifact.
4 Related Work
- Unity’s AssetDatabase has exposed GUID lookup for over a decade, and community scanners have long produced dependency reports.Source: §4 · p. 2
- SWE-bench [3] established repository-level benchmarks, while GameDevBench [2] covers Godot.Source: §4 · p. 2
- The authors report that no Unity-specific benchmark existed to their knowledge, motivating their benchmark artifact.Source: §4 · p. 2
5 Conclusion
Unity Insight is deployed in production as Tuanjie Codely’s built-in code–asset indexing layer, with five query tools serving as the agent’s native navigation surface. The paper proposes that other engines with decisive facts in serialized assets can adopt a persistent, read-only code–asset graph exposed through typed query tools.
5 Conclusion
- Unity Insight is the built-in code–asset indexing layer of Tuanjie Codely, where five query tools provide the agent’s native navigation surface for Unity projects.The paper reports that the paired experiment suggests roughly half the cost of raw agentic exploration.Source: §5 · p. 2
- Any engine whose decisive facts live in serialized assets rather than code can adopt a persistent, read-only code–asset graph exposed through typed query tools.Source: §5 · p. 2
- The authors expect asset-aware indexes to become standard agent infrastructure in game repositories, as language servers already are in mainstream code.Source: §5 · p. 2