[#97] Add Unity scenes to LeadingEdge reference builds#98
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds small Unity scenes and a SceneList ScriptableObject to the LeadingEdge fixture, updates build scripts to bundle scenes correctly, and introduces tests/docs to validate scene content in produced build outputs.
Changes:
- Generate two scenes sharing a texture and add a
SceneListasset that references them viaLoadableSceneId. - Update AssetBundle build script to output a dedicated
scenesbundle and refresh checked-in reference build artifacts. - Add NUnit coverage to sanity-check scene bundle contents and adjust dangling-ref expectations for built-in resources.
Reviewed changes
Copilot reviewed 28 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| UnityProjects/LeadingEdge/Assets/Textures/GreenStatic.png.meta | Adds import settings for the shared sprite texture used by generated scenes. |
| UnityProjects/LeadingEdge/Assets/Textures.meta | Adds metadata for the new Textures folder. |
| UnityProjects/LeadingEdge/Assets/Scripts/SceneList.cs.meta | Adds meta for the new SceneList ScriptableObject script. |
| UnityProjects/LeadingEdge/Assets/Scripts/SceneList.cs | Introduces a ScriptableObject that maps scene names to LoadableSceneIds. |
| UnityProjects/LeadingEdge/Assets/ScriptableObjects/SceneList.asset.meta | Adds meta for the generated SceneList asset. |
| UnityProjects/LeadingEdge/Assets/ScriptableObjects/SceneList.asset | Adds a generated asset mapping Scene1/Scene2 to scene GUIDs. |
| UnityProjects/LeadingEdge/Assets/ScriptableObjects/ContentDirectoryRoot.asset | Adds SceneList as an additional root reference for content directory builds. |
| UnityProjects/LeadingEdge/Assets/Scenes/Scene2.unity.meta | Adds meta for the second generated scene. |
| UnityProjects/LeadingEdge/Assets/Scenes/Scene2.unity | Adds the second generated scene referencing the shared sprite. |
| UnityProjects/LeadingEdge/Assets/Scenes/Scene1.unity.meta | Adds meta for the first generated scene. |
| UnityProjects/LeadingEdge/Assets/Scenes/Scene1.unity | Adds the first generated scene referencing the shared sprite. |
| UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs | Extends asset generation to create scenes and a SceneList asset. |
| UnityProjects/LeadingEdge/Assets/Editor/BuildAssetBundles.cs | Adds a dedicated scene bundle build alongside existing per-asset bundles. |
| UnityProjects/LeadingEdge/AGENTS.md | Updates project description and documents newly added scenes. |
| UnityDataTool.Tests/SceneBundleContentTests.cs | Adds tests validating the scenes AssetBundle structure/content and texture deduplication. |
| UnityDataTool.Tests/AnalyzeDanglingRefsTests.cs | Updates expectations to allow built-in resource dangling references. |
| TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/baff06b928d147276f2245dd3b19216a.json | Updates the checked-in content directory manifest to include scenes and new dependencies. |
| TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/BuildManifestHash.txt | Updates the manifest hash pointer to the new content directory manifest. |
| TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/15d5df98d98434e67e06716cfabfad1b.json | Removes the prior content directory manifest. |
| TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ScriptsOnlyCache.yaml | Updates build report cache to include SceneList / LoadableSceneId types. |
| TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentSizeSummary.txt | Updates build size summary reflecting inclusion of scenes/texture/built-ins. |
| TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentLayout.json | Updates ContentLayout.json with scene entries and new dependency structure. |
| TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildReportSummary.json | Updates build report summary fields for the new build output. |
| TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildLog.jsonl | Updates build log to reflect the new build steps/content. |
| TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildContentTEP.json | Updates TEP trace reflecting the new build content and durations. |
| TestCommon/Data/LeadingEdgeBuilds/AssetBundles/scenes.manifest | Adds manifest for the new scenes AssetBundle. |
| TestCommon/Data/LeadingEdgeBuilds/AssetBundles/AssetBundles.manifest | Updates root AssetBundles manifest to include scenes and new Unity version. |
| Documentation/contentdirectory-format.md | Documents how scenes appear in content directory builds and updates examples. |
Comments suppressed due to low confidence (3)
UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs:1
- GenerateScenes() creates new scenes using NewSceneMode.Single, which closes currently open scenes. When run from the menu, this can prompt users to save/lose work and can disrupt editor state during automation. Consider creating scenes in Additive mode (and closing them after saving) or capturing/restoring the previously open scenes/active scene after generation.
UnityProjects/LeadingEdge/Assets/Scripts/SceneList.cs:1 - This is a public mutable field on a ScriptableObject asset. That makes it easy for runtime code to accidentally modify the asset's serialized state (in-editor) or the in-memory data. A more robust API is to keep the backing field private
[SerializeField]and expose a read-only view (e.g., via a getter returningIReadOnlyDictionary<string, LoadableSceneId>), so callers can query without mutating.
UnityProjects/LeadingEdge/Assets/Scripts/SceneList.cs.meta:1 - This
.metafile looks incomplete for a C# script asset (it typically includes aMonoImporter:section with default settings). Unity will likely regenerate it on import, creating noisy diffs and potential merge churn. Re-export/regenerate the meta from Unity so it matches the standard script meta format (while preserving the GUID).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #97.
Adds two small Unity scenes to the LeadingEdge test project so the reference builds cover scene content. Scenes are a special case in every build pipeline, and the initial test project had none in its output. Both scenes show the shared
GreenStatic.pngtexture through a SpriteRenderer (with distinct GameObject names so their content differs), and a newSceneListScriptableObject references them by name through a serialized dictionary ofLoadableSceneId, which is what pulls them into the Content Directory build.The regenerated Content Directory output now demonstrates the scene conventions worth documenting: each scene becomes exactly one Content File (with the scene's GUID as its stable
.cfididentity), the assets a scene references land in their own Content Files, andLoadableSceneIdreferences are recorded in the manifest (LoadableSceneDependencies) rather than the external-reference table.Changes
LeadingEdge project
GenerateAssets.csgenerates the two scenes (imports the texture as a Sprite) and theSceneList.asset, which is added toContentDirectoryRoot.asset's direct references.BuildAssetBundles.csadds ascenesbundle containing both scenes (AssetBundles require scenes and assets in separate bundles).AGENTS.mddescribes the new scene scenario; the tracked editor version moved to 6000.6.0b5.Reference data (
TestCommon/Data/LeadingEdgeBuilds)scenesbundle; existing bundles are unchanged.ContentLayout.json, now listingLoadableSceneIds) regenerated. New Content Files for the scenes, the Sprite/Texture2D split ofGreenStatic.png,unity_builtin_extra, and theSceneListasset.Tests
SceneBundleContentTests: verifies the scenes bundle contains one SerializedFile per scene (plus sharedAssets), that scene files hold the expected objects via theserialized-filecommand, and that the shared texture is included exactly once.Analyze_FullAssetBundleSet_ResolvesCrossBundleReferencesnow excludes references into Unity's built-in resource files (unity_builtin_extra,unity default resources), which the scene bundle introduces and which always dangle.Documentation
contentdirectory-format.mdgains a Scenes section: how scenes enter a build throughLoadableSceneId, the one-Content-File-per-scene rule (contrasted with Player builds'sharedassetssplit), sequential object IDs in scene files, and workedContentLayout.jsonexamples from the reference build. Schema details stay on thecontentlayout.mdpage.Testing
dotnet test— full suite green (730 passed, 10 skipped). New scene coverage as described above; manually verified the scenes bundle and the scene/SceneList Content Files witharchive list/extract,serialized-file objectlist, anddump, and cross-checked the documented examples against the regeneratedContentLayout.json.