diff --git a/.gitignore b/.gitignore index de49506..468dee6 100644 --- a/.gitignore +++ b/.gitignore @@ -32,12 +32,13 @@ .claude -UnityFileSystemTestData/AssetBundles/ -UnityFileSystemTestData/**/*.csproj -UnityFileSystemTestData/**/*.sln -UnityFileSystemTestData/ProjectSettings/ -UnityFileSystemTestData/UserSettings/ -UnityFileSystemTestData/Packages/ +UnityProjects/**/*.csproj +UnityProjects/**/*.sln +UnityProjects/**/AssetBundles/ +UnityProjects/**/ProjectSettings/ +UnityProjects/**/UserSettings/ +UnityProjects/**/Packages/ +UnityProjects/**/Builds/ *.db *.csv diff --git a/AGENTS.md b/AGENTS.md index 39cabdc..ac51699 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -174,4 +174,6 @@ To use a specific Unity version's library: * TestCommon/Data contains small reference files extracted from Unity builds (player and AssetBundles). These are used by the automated tests and also useful for manual testing. -* UnityFileSystemTestData is a Unity project that generates test data for the test suites. +* UnityProjects contains two Unity projects that generate test data for the test suites: + * `Baseline` - tracks stable, broadly-used Unity versions and is upgraded only when necessary. Most UnityDataTools users inspect output from these versions. Its `TypeIdRegistryGenerator` regenerates `UnityFileSystem/TypeIdRegistry.cs`. + * `LeadingEdge` - tracks the newest Unity version (currently the 6.6 beta) and is updated proactively so newer build features (Content Directory builds, serialized dictionaries, etc.) can be tested. diff --git a/CLAUDE.md b/CLAUDE.md index 47dc3e3..eef4bd2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1 +1 @@ -AGENTS.md \ No newline at end of file +@AGENTS.md \ No newline at end of file diff --git a/Documentation/command-find-refs.md b/Documentation/command-find-refs.md index 3e44fe2..b2ec988 100644 --- a/Documentation/command-find-refs.md +++ b/Documentation/command-find-refs.md @@ -1,9 +1,9 @@ # find-refs Command -> ⚠️ **Experimental:** This command may not work as expected in all cases. - The `find-refs` command traces reference chains leading to specific objects. Use it to understand why an asset was included (and potentially duplicated) in a build. +It walks *up* the reference graph from the target object and **stops at the first asset it reaches**. The reported chains therefore end at the immediate containing asset, not at the ultimate root that transitively depends on the target. For example, if `RootAsset` references `LeafAsset` which references a texture, searching for the texture reports the chain ending at `LeafAsset`; to see that `RootAsset` pulls it in, search for `LeafAsset` instead. + ## Quick Reference ``` @@ -16,10 +16,13 @@ UnityDataTool find-refs [options] | `-i, --object-id ` | ID of object to analyze (from `id` column) | — | | `-n, --object-name ` | Name of objects to analyze | — | | `-t, --object-type ` | Type filter when using `-n` | — | -| `-o, --output-file ` | Output filename | — | +| `-o, --output-file ` | Output filename | `references.txt` | +| `--stdout` | Write the reference chains to stdout instead of a file | `false` | | `-a, --find-all` | Find all chains instead of stopping at first | `false` | > **Note:** Either `--object-id` or `--object-name` must be provided. +> +> `--stdout` and `-o/--output-file` are mutually exclusive. ## Prerequisites @@ -29,14 +32,19 @@ This command requires a database created by the [`analyze`](command-analyze.md) ## Examples -Find references to an object by name and type: +Find references to an object by name and type, printing directly to the console: +```bash +UnityDataTool find-refs my_database.db -n "MyTexture" -t "Texture2D" --stdout +``` + +Write the reference chains to a file instead: ```bash UnityDataTool find-refs my_database.db -n "MyTexture" -t "Texture2D" -o refs.txt ``` Find references to a specific object by ID: ```bash -UnityDataTool find-refs my_database.db -i 12345 -o refs.txt +UnityDataTool find-refs my_database.db -i 12345 --stdout ``` Find all duplicate references (useful for finding why an asset is duplicated): diff --git a/README.md b/README.md index 1d6e0a1..04d0daf 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The repository contains the following items: * UnityFileSystem: source code and binaries of a .NET class library exposing the functionalities or the UnityFileSystemApi native library. * UnityFileSystem.Tests: test suite for the UnityFileSystem library. -* UnityFileSystemTestData: the Unity project used to generate the test data. +* UnityProjects: Unity projects used to generate some of the test data. * TestCommon: a helper library used by the test projects. ## Downloads diff --git a/ReferenceFinder/ReferenceFinderTool.cs b/ReferenceFinder/ReferenceFinderTool.cs index 3c5926a..104c3bf 100644 --- a/ReferenceFinder/ReferenceFinderTool.cs +++ b/ReferenceFinder/ReferenceFinderTool.cs @@ -24,21 +24,14 @@ public class ReferenceFinderTool List m_Roots = new List(); HashSet<(long, string)> m_ProcessedObjects = new HashSet<(long, string)>(); - StreamWriter m_Writer; + TextWriter m_Writer; - public int FindReferences(string objectName, string objectType, string databasePath, string outputFile, bool findAll) + public int FindReferences(string objectName, string objectType, string databasePath, string outputFile, bool findAll, bool toStdout = false) { var objectIds = new List(); - SqliteConnection db; - - try - { - db = new SqliteConnection($"Data Source={databasePath};Version=3;Foreign Keys=False;"); - db.Open(); - } - catch (Exception e) + using var db = OpenDatabase(databasePath); + if (db == null) { - Console.WriteLine($"Error opening database: {e.Message}"); return 1; } @@ -81,33 +74,50 @@ public int FindReferences(string objectName, string objectType, string databaseP return 1; } - return FindReferences(db, outputFile, objectIds, findAll); + return FindReferences(db, outputFile, objectIds, findAll, toStdout); } - public int FindReferences(long objectId, string databasePath, string outputFile, bool findAll) + public int FindReferences(long objectId, string databasePath, string outputFile, bool findAll, bool toStdout = false) { var objectIds = new List(); - SqliteConnection db; + using var db = OpenDatabase(databasePath); + if (db == null) + { + return 1; + } + objectIds.Add(objectId); + + return FindReferences(db, outputFile, objectIds, findAll, toStdout); + } + + // Opens the analyze database for reading. Uses SqliteConnectionStringBuilder (matching SQLiteWriter) rather than a + // hand-written connection string, which used a legacy System.Data.SQLite keyword that Microsoft.Data.Sqlite rejects. + static SqliteConnection OpenDatabase(string databasePath) + { try { - db = new SqliteConnection($"Data Source={databasePath};Version=3;Foreign Keys=False;"); + var connectionString = new SqliteConnectionStringBuilder + { + DataSource = databasePath, + Mode = SqliteOpenMode.ReadOnly, + Pooling = false, + ForeignKeys = false, + }.ConnectionString; + var db = new SqliteConnection(connectionString); db.Open(); + return db; } catch (Exception e) { Console.WriteLine($"Error opening database: {e.Message}"); - return 1; + return null; } - - objectIds.Add(objectId); - - return FindReferences(db, outputFile, objectIds, findAll); } - int FindReferences(SqliteConnection db, string outputFile, IList objectIds, bool findAll) + int FindReferences(SqliteConnection db, string outputFile, IList objectIds, bool findAll, bool toStdout) { - m_Writer = new StreamWriter(outputFile); + m_Writer = toStdout ? Console.Out : new StreamWriter(outputFile); m_GetRefsCommand = db.CreateCommand(); m_GetRefsCommand.CommandText = @"SELECT object, property_path, EXISTS (SELECT * FROM assets a WHERE a.object = r.object) FROM refs r WHERE referenced_object = @id"; @@ -181,7 +191,11 @@ FROM object_view o } } - m_Writer.Close(); + // Don't close Console.Out when writing to stdout; just flush it. + if (toStdout) + m_Writer.Flush(); + else + m_Writer.Close(); return 0; } @@ -196,10 +210,13 @@ void OutputReferenceNode(ReferenceTreeNode node, string propertyPath, int indent { reader.Read(); + // game_object and script come from correlated subqueries that yield NULL when there is no matching row + // (e.g. a ScriptableObject is a MonoBehaviour whose m_GameObject PPtr is 0, or a MonoBehaviour with no + // m_Script reference), so both must be null-checked. var objectType = reader.GetString(0); var objectName = reader.GetString(1); - var gameObject = reader.GetString(2); - var script = reader.GetString(3); + var gameObject = reader.IsDBNull(2) ? "" : reader.GetString(2); + var script = reader.IsDBNull(3) ? "" : reader.GetString(3); if (propertyPath != "") { diff --git a/TestCommon/Data/AssetBundles/AGENTS.md b/TestCommon/Data/AssetBundles/AGENTS.md new file mode 100644 index 0000000..6a2997c --- /dev/null +++ b/TestCommon/Data/AssetBundles/AGENTS.md @@ -0,0 +1,5 @@ +# AssetBundle test data + +AssetBundle build output used by the UnityDataTools test suites, kept in a subfolder per Unity version (`2019.4.0f1` through `2023.1.0a16`). Each holds the `assetbundle` and `scenes` bundles built from the project's assets; some versions also include additional fixtures used by specific tests. + +Generated by the `UnityProjects/Baseline` project - run **Tools > Generate AssetBundles** there (built for StandaloneOSX and copied here under the Unity version). See that project's `AGENTS.md` for the assets that go into the bundles. diff --git a/TestCommon/Data/AssetBundles/CLAUDE.md b/TestCommon/Data/AssetBundles/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/TestCommon/Data/AssetBundles/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/TestCommon/Data/LeadingEdgeBuilds/AGENTS.md b/TestCommon/Data/LeadingEdgeBuilds/AGENTS.md new file mode 100644 index 0000000..977dfac --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AGENTS.md @@ -0,0 +1,12 @@ +# LeadingEdge reference builds + +The checked-in build output of the `UnityProjects/LeadingEdge` project, for use in automated and ad hoc tests. See that project's `AGENTS.md` for the test scenarios and how the assets are set up. + +The LeadingEdge build scripts regenerate this folder directly, so to update it, rebuild in that project and check in the results. + +## Layout + +* `AssetBundles/` - the AssetBundle build: one bundle per asset (named after the asset) plus the `AssetBundles` manifest bundle. +* `ContentDirectory/` - the Content Directory build: content (`.cf`) files, `.resource` files and the build manifest. +* `BuildReport-AssetBundles/LastBuild.buildreport` - the AssetBundle build report. +* `BuildReport-ContentDirectory/` - the Content Directory build report folder, including `ContentLayout.json`. diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/6 b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/6 new file mode 100644 index 0000000..ea1762c Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/6 differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/6.manifest b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/6.manifest new file mode 100644 index 0000000..8402467 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/6.manifest @@ -0,0 +1,21 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.6.0b3 +CRC: 4272264984 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: 256fc0686cc70288ca0c8f6d88bc4cfc + TypeTreeHash: + serializedVersion: 2 + Hash: 9a2ca7bdbd1871f7131daf57de908e0c + IncrementalBuildHash: + serializedVersion: 2 + Hash: e4d5b2148b8da35f0919e0024f8e9095 +HashAppended: 0 +ClassTypes: +- Class: 83 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: [] +Assets: +- Assets/Audio/6.mp3 +Dependencies: [] diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/AssetBundles b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/AssetBundles new file mode 100644 index 0000000..ebb2351 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/AssetBundles differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/AssetBundles.manifest b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/AssetBundles.manifest new file mode 100644 index 0000000..1e77c6d --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/AssetBundles.manifest @@ -0,0 +1,30 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.6.0b3 +CRC: 3235539447 +HashAppended: 0 +AssetBundleManifest: + AssetBundleInfos: + Info_0: + Name: assetbundleroot + Dependencies: + Dependency_0: directaudioclipreference + Dependency_1: singleaudioclipdirectreference + Dependency_2: serializationdemo + Info_1: + Name: directaudioclipreference + Dependencies: + Dependency_0: 6 + Dependency_1: a + Info_2: + Name: singleaudioclipdirectreference + Dependencies: + Dependency_0: a + Info_3: + Name: serializationdemo + Dependencies: {} + Info_4: + Name: 6 + Dependencies: {} + Info_5: + Name: a + Dependencies: {} diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a new file mode 100644 index 0000000..c19e7c6 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a.manifest b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a.manifest new file mode 100644 index 0000000..296af19 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a.manifest @@ -0,0 +1,21 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.6.0b3 +CRC: 3543150657 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: 27584a7667a63eb913bc1cc20ff4c416 + TypeTreeHash: + serializedVersion: 2 + Hash: 9a2ca7bdbd1871f7131daf57de908e0c + IncrementalBuildHash: + serializedVersion: 2 + Hash: 8e2f9ab0bd28d271a63e0ad1c392e317 +HashAppended: 0 +ClassTypes: +- Class: 83 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: [] +Assets: +- Assets/Audio/a.mp3 +Dependencies: [] diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/assetbundleroot b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/assetbundleroot new file mode 100644 index 0000000..5660281 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/assetbundleroot differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/assetbundleroot.manifest b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/assetbundleroot.manifest new file mode 100644 index 0000000..cfc3b11 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/assetbundleroot.manifest @@ -0,0 +1,34 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.6.0b3 +CRC: 1569140202 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: d7f919acab03f8314047c9954b2f35d3 + TypeTreeHash: + serializedVersion: 2 + Hash: e4c92e7ce30487f41e62ec475c399971 + IncrementalBuildHash: + serializedVersion: 2 + Hash: 1dbce57dbf052f5659ad2cc7eb1ce772 +HashAppended: 0 +ClassTypes: +- Class: 114 + Script: {fileID: 11500000, guid: d6330d3e9b8e5a0439e4dd147cec19dd, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 8623c5efbb626994da80931050f0aba0, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: f44aeb02ae06dd84bb3ef76e1df8d525, type: 3} +- Class: 115 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: +- AssemblyName: Assembly-CSharp + ClassName: SerializationDemo/SerializedData +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.DictionarySerialization/SerializedKeyValue`2 +Assets: +- Assets/ScriptableObjects/AssetBundleRoot.asset +Dependencies: +- C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/AssetBundles/directaudioclipreference +- C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/AssetBundles/serializationdemo +- C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/AssetBundles/singleaudioclipdirectreference diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/directaudioclipreference b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/directaudioclipreference new file mode 100644 index 0000000..7b824a1 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/directaudioclipreference differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/directaudioclipreference.manifest b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/directaudioclipreference.manifest new file mode 100644 index 0000000..94beb6f --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/directaudioclipreference.manifest @@ -0,0 +1,29 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.6.0b3 +CRC: 2898859186 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: 81b1dfeb6b75ecfa0e6d2ac8a2ace1a1 + TypeTreeHash: + serializedVersion: 2 + Hash: 4c88c857f41d6968a1090f557f31c5ed + IncrementalBuildHash: + serializedVersion: 2 + Hash: 550b678d70753dc54c9731a6aac37c3b +HashAppended: 0 +ClassTypes: +- Class: 83 + Script: {instanceID: 0} +- Class: 114 + Script: {fileID: 11500000, guid: d6330d3e9b8e5a0439e4dd147cec19dd, type: 3} +- Class: 115 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.DictionarySerialization/SerializedKeyValue`2 +Assets: +- Assets/ScriptableObjects/DirectAudioClipReference.asset +Dependencies: +- C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/AssetBundles/6 +- C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/serializationdemo b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/serializationdemo new file mode 100644 index 0000000..1c0d928 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/serializationdemo differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/serializationdemo.manifest b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/serializationdemo.manifest new file mode 100644 index 0000000..4a24e03 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/serializationdemo.manifest @@ -0,0 +1,25 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.6.0b3 +CRC: 1465243436 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: 126f385e23d41aca13d7233b6051d3a1 + TypeTreeHash: + serializedVersion: 2 + Hash: d0726b8e1199eb6125e2245ce15343f9 + IncrementalBuildHash: + serializedVersion: 2 + Hash: 6b339242357a8a3b47aa14706dd55d35 +HashAppended: 0 +ClassTypes: +- Class: 114 + Script: {fileID: 11500000, guid: f44aeb02ae06dd84bb3ef76e1df8d525, type: 3} +- Class: 115 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: +- AssemblyName: Assembly-CSharp + ClassName: SerializationDemo/SerializedData +Assets: +- Assets/ScriptableObjects/SerializationDemo.asset +Dependencies: [] diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/singleaudioclipdirectreference b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/singleaudioclipdirectreference new file mode 100644 index 0000000..df3eb93 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/singleaudioclipdirectreference differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/singleaudioclipdirectreference.manifest b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/singleaudioclipdirectreference.manifest new file mode 100644 index 0000000..3269ba3 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/AssetBundles/singleaudioclipdirectreference.manifest @@ -0,0 +1,28 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.6.0b3 +CRC: 1978978241 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: 44348aaed65aa7c68787f1d802830080 + TypeTreeHash: + serializedVersion: 2 + Hash: 4c88c857f41d6968a1090f557f31c5ed + IncrementalBuildHash: + serializedVersion: 2 + Hash: 87245ee368dca05768c0237d53749a44 +HashAppended: 0 +ClassTypes: +- Class: 83 + Script: {instanceID: 0} +- Class: 114 + Script: {fileID: 11500000, guid: d6330d3e9b8e5a0439e4dd147cec19dd, type: 3} +- Class: 115 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.DictionarySerialization/SerializedKeyValue`2 +Assets: +- Assets/ScriptableObjects/SingleAudioClipDirectReference.asset +Dependencies: +- C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/AssetBundles/a diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-AssetBundles/LastBuild.buildreport b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-AssetBundles/LastBuild.buildreport new file mode 100644 index 0000000..d52d4d7 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-AssetBundles/LastBuild.buildreport differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/2e3fcc980d14c6a498d140ac0a24af65.buildreport b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/2e3fcc980d14c6a498d140ac0a24af65.buildreport new file mode 100644 index 0000000..5ee07d1 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/2e3fcc980d14c6a498d140ac0a24af65.buildreport differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildContentTEP.json b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildContentTEP.json new file mode 100644 index 0000000..5fce5be --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildContentTEP.json @@ -0,0 +1,155 @@ +{ + +"Instructions": "1) Open Chrome or Edge, 2) go to chrome://tracing, 3) click Load, 4) navigate to this file.", + + +"UnityVersion": "6000.6.0b3", +"OperatingSystem": "Windows 11 (10.0.26200) Professional", +"ProcessorType": "12th Gen Intel(R) Core(TM) i9-12900K", +"ProcessorFrequencyMHz": 3187, +"ProcessorCount": 24, +"PhysicalProcessorCount": 16, +"PhysicalMemoryMB": 65277, +"traceEvents": [ +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984069307, "dur": 26861, "name": "ApplyBuildHistoryRetention"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984096172, "dur": 5065596, "name": "UnifiedBuild"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984096222, "dur": 47, "name": "Validate Root Assets"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984099953, "dur": 35253, "name": "InitializeBuildCallbacks:BuildProcessors, SceneProcessors, FilterAssembliesProcessors, ShaderProcessors, ComputeShaderProcessors"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984135222, "dur": 18, "name": "OnBuildStepBegin", "args": {"step": "Refresh Asset Database", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984135554, "dur": 69508, "name": "BuildPipeline::RegisterCustomDependencies"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984205360, "dur": 238, "name": "OnBuildStepEnd", "args": {"step": "Refresh Asset Database", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984205631, "dur": 11, "name": "OnBuildStepBegin", "args": {"step": "Call Pre-Process callbacks", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984206428, "dur": 105, "name": "ContentSelectionBuildPreprocessor.OnPreprocessBuild:WithContext"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984206543, "dur": 7, "name": "OnBuildStepEnd", "args": {"step": "Call Pre-Process callbacks", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984210294, "dur": 56795, "name": "ConfigureTargetPlatform"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984210300, "dur": 21, "name": "OnBuildStepBegin", "args": {"step": "Configure target platform", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984214143, "dur": 52896, "name": "CompressAssets"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984267045, "dur": 20, "name": "OnBuildStepEnd", "args": {"step": "Configure target platform", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984267091, "dur": 1496049, "name": "ReCompileScripts"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352984267097, "dur": 11, "name": "OnBuildStepBegin", "args": {"step": "Compile scripts", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352985763077, "dur": 25, "name": "OnBuildStepEnd", "args": {"step": "Compile scripts", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352985763564, "dur": 12172, "name": "LoadingTypeDB"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352985775747, "dur": 302474, "name": "DeleteCachedBuildArtifacts"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352986078234, "dur": 2929736, "name": "GatherBuildMetaData"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352986078250, "dur": 23, "name": "OnBuildStepBegin", "args": {"step": "Gather and collect build metadata", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352986078569, "dur": 2929269, "name": "BuildPipeline::GatherAllAssetMetadata"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989007846, "dur": 11, "name": "BuildPipeline::GatherMainObjectIdsForInitialAssets"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989007860, "dur": 2, "name": "BuildPipeline::GatherBuiltInObjectIds"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989007865, "dur": 4, "name": "BuildPipeline::BuildObjectIdToGlobalObjectIdMap"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989007873, "dur": 3, "name": "BuildPipeline::BuildObjectIdToObjectBuildMetaDataMap"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989007878, "dur": 13, "name": "BuildPipeline::CombineGlobalUsageFromMetadata"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989007913, "dur": 15, "name": "OnBuildStepEnd", "args": {"step": "Gather and collect build metadata", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989007979, "dur": 14, "name": "OnBuildStepBegin", "args": {"step": "Calculate build layout", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989008392, "dur": 97, "name": "BuildLayout"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989008491, "dur": 7, "name": "OnBuildStepEnd", "args": {"step": "Calculate build layout", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989008517, "dur": 10, "name": "OnBuildStepBegin", "args": {"step": "Aggregate build usage for objects", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989008795, "dur": 13, "name": "BuildPipeline::AggregateBuildUsageForObjectIds"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989008809, "dur": 6, "name": "OnBuildStepEnd", "args": {"step": "Aggregate build usage for objects", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989008832, "dur": 6, "name": "OnBuildStepBegin", "args": {"step": "Generate build instructions", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009020, "dur": 104, "name": "BuildPipeline::BuildInstructionHelper::GenerateBuildInstructions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009027, "dur": 25, "name": "GenerateBuildInstruction"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009062, "dur": 11, "name": "GenerateBuildInstruction"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009078, "dur": 12, "name": "GenerateBuildInstruction"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009093, "dur": 5, "name": "GenerateBuildInstruction"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009101, "dur": 3, "name": "GenerateBuildInstruction"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009108, "dur": 6, "name": "GenerateBuildInstruction"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009118, "dur": 5, "name": "GenerateBuildInstruction"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009127, "dur": 59473, "name": "SerializeInstructions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009132, "dur": 7, "name": "OnBuildStepBegin", "args": {"step": "Serialize build instructions", "depth": "2"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009311, "dur": 2524, "name": "SerializeBuildInstructions", "args": {"Count": "7", "changedCount": "7", "unchangedCount": "0", "bytesWritten": "3600", "bytesHashed": "3600"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009313, "dur": 55, "name": "InstructionSet:LoadVersions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009369, "dur": 7, "name": "InstructionSet:HashInstructions", "args": {"totalBytesHashed": "3600"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009377, "dur": 22, "name": "InstructionSet:PrepareWriteTasks", "args": {"taskCount": "7", "bytesWritten": "3600"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989009400, "dur": 2236, "name": "InstructionSet:WriteChangedInstructions", "args": {"changedCount": "7", "bytesWritten": "3600"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989011637, "dur": 178, "name": "InstructionSet:UpdateVersionMap"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989011836, "dur": 56722, "name": "AssetDatabase Refresh"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068562, "dur": 12, "name": "OnBuildStepEnd", "args": {"step": "Serialize build instructions", "depth": "2"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068601, "dur": 3, "name": "OnBuildStepEnd", "args": {"step": "Generate build instructions", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068626, "dur": 7, "name": "OnBuildStepBegin", "args": {"step": "Execute instructions", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068936, "dur": 51589, "name": "ExecuteBuildInstructions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068941, "dur": 51584, "name": "BuildPipeline::BuildInstructionHelper::ProduceSerializedFilesForBuildInstructions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068942, "dur": 30, "name": "Build Instructions to GUIDs"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068975, "dur": 5, "name": "Filter Up to Date Build Instructions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068981, "dur": 723, "name": "Precompile Shaders From Build Instructions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989068982, "dur": 8, "name": "OnBuildStepBegin", "args": {"step": "Precompile Shaders", "depth": "2"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989069234, "dur": 441, "name": "BuildPipeline::PreCompileShadersFromInstructions"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989069671, "dur": 3, "name": "BuildPipeline::PreCompileShaders"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989069677, "dur": 9, "name": "OnBuildStepEnd", "args": {"step": "Precompile Shaders", "depth": "2"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989069706, "dur": 11, "name": "OnBuildStepBegin", "args": {"step": "Write serialized files", "depth": "2"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989069929, "dur": 50555, "name": "Write serialized files"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989120488, "dur": 14, "name": "OnBuildStepEnd", "args": {"step": "Write serialized files", "depth": "2"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989120530, "dur": 3, "name": "OnBuildStepEnd", "args": {"step": "Execute instructions", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989120541, "dur": 550, "name": "BuildPipeline::BuildInstructionHelper::PopulateContentFileBuildResults"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989121096, "dur": 13, "name": "OnBuildStepBegin", "args": {"step": "Generate build manifest", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989121416, "dur": 101, "name": "BuildPipeline::CreateManifestJsonText"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989121518, "dur": 102, "name": "WriteBuildManifestToUDS"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989121649, "dur": 6, "name": "OnBuildStepEnd", "args": {"step": "Generate build manifest", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989121668, "dur": 11467, "name": "BuildPipeline::ExportPlayerArtifactsToDirectory"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989133191, "dur": 31, "name": "OnBuildStepBegin", "args": {"step": "Clean output directory", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989133546, "dur": 284, "name": "BuildPipeline::CleanupUnreferencedFilesFromBuildOutput"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989133836, "dur": 18, "name": "OnBuildStepEnd", "args": {"step": "Clean output directory", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989134208, "dur": 2019, "name": "PopulateBuildReport"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989134213, "dur": 25, "name": "OnBuildStepBegin", "args": {"step": "Populate build report", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989134656, "dur": 1466, "name": "BuildPipeline::CalculateAndRecordContentSummary"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989136187, "dur": 14, "name": "OnBuildStepEnd", "args": {"step": "Populate build report", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989136233, "dur": 10, "name": "OnBuildStepBegin", "args": {"step": "Record type usage", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989136534, "dur": 4560, "name": "BuildPipeline::WriteTypeUsage"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989137396, "dur": 1357, "name": "BuildPipeline::PopulateRuntimeClassRegistry"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989141104, "dur": 14, "name": "OnBuildStepEnd", "args": {"step": "Record type usage", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989141154, "dur": 8, "name": "OnBuildStepBegin", "args": {"step": "Generate build layout", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989141454, "dur": 226, "name": "BuildPipeline::CreateLayoutJsonText"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989141972, "dur": 12, "name": "OnBuildStepEnd", "args": {"step": "Generate build layout", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989142183, "dur": 11, "name": "OnBuildStepBegin", "args": {"step": "Finalize ContentBuildRoot", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989142528, "dur": 6, "name": "OnBuildStepEnd", "args": {"step": "Finalize ContentBuildRoot", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989142549, "dur": 1, "name": "ResetActiveTargetPlatform"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989142553, "dur": 6467, "name": "BuildPipeline::CleanupAfterBuild"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989142555, "dur": 6, "name": "OnBuildStepBegin", "args": {"step": "Clean up after build", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989148982, "dur": 10, "name": "OnBuildStepEnd", "args": {"step": "Clean up after build", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989149022, "dur": 9898, "name": "Unloading unused assets immediately"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989149025, "dur": 6, "name": "OnBuildStepBegin", "args": {"step": "Unloading unused assets", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989158869, "dur": 24, "name": "OnBuildStepEnd", "args": {"step": "Unloading unused assets", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989161762, "dur": 2, "name": "ResetActiveTargetPlatform"}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989161774, "dur": 18, "name": "OnBuildStepBegin", "args": {"step": "Call Post-Process callbacks", "depth": "1"}}, +{"pid": 4000, "tid": 27228, "ph": "X", "ts": 352989162686, "dur": 9, "name": "OnBuildStepEnd", "args": {"step": "Call Post-Process callbacks", "depth": "1"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988951204, "dur": 23577, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/ScriptableObjects/ContentDirectoryRoot.asset"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988951290, "dur": 11413, "name": "LoadingTypeDB"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988962737, "dur": 11877, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988987409, "dur": 1690, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/ScriptableObjects/LoadableAudioClipReference.asset"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988987484, "dur": 1479, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988990836, "dur": 2452, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/ScriptableObjects/SerializationDemo.asset"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988990896, "dur": 2211, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988995000, "dur": 335, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/Scripts/DirectScriptableObjectReference.cs"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988995058, "dur": 170, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988997043, "dur": 1393, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988997122, "dur": 1200, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988999537, "dur": 626, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/Audio/a.mp3"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352988999593, "dur": 485, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989001016, "dur": 283, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/Scripts/SerializationDemo.cs"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989001072, "dur": 140, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989002163, "dur": 588, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/Audio/6.mp3"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989002220, "dur": 453, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989003599, "dur": 321, "name": "BuildMetaDataImporter(worker)", "args": {"assetPath": "Assets/Scripts/LoadableAudioClipReference.cs"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989003658, "dur": 137, "name": "BuildPipeline::CalculateBuildMetaDataForAsset"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989079059, "dur": 6224, "name": "BuildInstructionImporter(worker)", "args": {"assetPath": "Library/BuildInstructions/21679be819d6e9146a63bb02a7e51f2f.buildinst"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989079181, "dur": 6048, "name": "BuildPipeline::WriteSerializedFile", "args": {"filePath": "mem:/Temp/21679be819d6e9146a63bb02a7e51f2f.cfid"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989079273, "dur": 457, "name": "BuildPipeline::PopulateWriteData"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989089340, "dur": 1907, "name": "BuildInstructionImporter(worker)", "args": {"assetPath": "Library/BuildInstructions/4038ff673d390134d924b57fcbed0432.buildinst"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989089465, "dur": 1733, "name": "BuildPipeline::WriteSerializedFile", "args": {"filePath": "mem:/Temp/4038ff673d390134d924b57fcbed0432.cfid"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989089517, "dur": 427, "name": "BuildPipeline::PopulateWriteData"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989093331, "dur": 2973, "name": "BuildInstructionImporter(worker)", "args": {"assetPath": "Library/BuildInstructions/52b43dad178849b42ac753005736e7bb.buildinst"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989093460, "dur": 2805, "name": "BuildPipeline::WriteSerializedFile", "args": {"filePath": "mem:/Temp/52b43dad178849b42ac753005736e7bb.cfid"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989093536, "dur": 1199, "name": "BuildPipeline::PopulateWriteData"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989098000, "dur": 1708, "name": "BuildInstructionImporter(worker)", "args": {"assetPath": "Library/BuildInstructions/20408785117e138f38c2cc4ca0e638c8.buildinst"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989098150, "dur": 1525, "name": "BuildPipeline::WriteSerializedFile", "args": {"filePath": "mem:/Temp/20408785117e138f38c2cc4ca0e638c8.cfid"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989098184, "dur": 454, "name": "BuildPipeline::PopulateWriteData"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989101268, "dur": 1109, "name": "BuildInstructionImporter(worker)", "args": {"assetPath": "Library/BuildInstructions/a2a42d71dddef12e8889849faf59bdd7.buildinst"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989101373, "dur": 965, "name": "BuildPipeline::WriteSerializedFile", "args": {"filePath": "mem:/Temp/a2a42d71dddef12e8889849faf59bdd7.cfid"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989101389, "dur": 11, "name": "BuildPipeline::PopulateWriteData"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989104364, "dur": 1565, "name": "BuildInstructionImporter(worker)", "args": {"assetPath": "Library/BuildInstructions/dd30e3af3b8bddf1ea36d768fc41aafd.buildinst"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989104477, "dur": 1417, "name": "BuildPipeline::WriteSerializedFile", "args": {"filePath": "mem:/Temp/dd30e3af3b8bddf1ea36d768fc41aafd.cfid"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989104513, "dur": 354, "name": "BuildPipeline::PopulateWriteData"}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989107598, "dur": 2669, "name": "BuildInstructionImporter(worker)", "args": {"assetPath": "Library/BuildInstructions/78532141fd7679a458405eb16bdb75fd.buildinst"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989107705, "dur": 2522, "name": "BuildPipeline::WriteSerializedFile", "args": {"filePath": "mem:/Temp/78532141fd7679a458405eb16bdb75fd.cfid"}}, +{"pid": 41552, "tid": 39536, "ph": "X", "ts": 352989107728, "dur": 384, "name": "BuildPipeline::PopulateWriteData"} +] +} \ No newline at end of file diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildLog.jsonl b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildLog.jsonl new file mode 100644 index 0000000..dee2d78 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildLog.jsonl @@ -0,0 +1,45 @@ +{"timestamp":"2026-07-01T13:30:16.277275300Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"BuildStart\",\"rootAssetCount\":1,\"startTime\":\"2026-07-01T13:30:16.2564912Z\",\"targetPlatform\":19,\"subtarget\":2,\"metadataPath\":\"Library/BuildHistory/20260701-133016Z-2e3fcc98\",\"outputPath\":\"C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/ContentDirectory\",\"rootAssetPaths\":[\"Assets/ScriptableObjects/ContentDirectoryRoot.asset\"]}"} +{"timestamp":"2026-07-01T13:30:16.343773900Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Refresh Asset Database\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:16.414109800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Refresh Asset Database\",\"depth\":1,\"durationTicks\":698475}"} +{"timestamp":"2026-07-01T13:30:16.414140200Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Call Pre-Process callbacks\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:16.415055200Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Call Pre-Process callbacks\",\"depth\":1,\"durationTicks\":9127}"} +{"timestamp":"2026-07-01T13:30:16.418831200Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Configure target platform\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:16.475576300Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Configure target platform\",\"depth\":1,\"durationTicks\":567430}"} +{"timestamp":"2026-07-01T13:30:16.475605700Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Compile scripts\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:17.971623900Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Compile scripts\",\"depth\":1,\"durationTicks\":14959749}"} +{"timestamp":"2026-07-01T13:30:18.286822300Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Gather and collect build metadata\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.216457000Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Gather and collect build metadata\",\"depth\":1,\"durationTicks\":29296630}"} +{"timestamp":"2026-07-01T13:30:21.216490600Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Calculate build layout\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.217002800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Calculate build layout\",\"depth\":1,\"durationTicks\":5118}"} +{"timestamp":"2026-07-01T13:30:21.217024100Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Aggregate build usage for objects\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.217316400Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Aggregate build usage for objects\",\"depth\":1,\"durationTicks\":2918}"} +{"timestamp":"2026-07-01T13:30:21.217334500Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Generate build instructions\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.217639700Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Serialize build instructions\",\"depth\":2}"} +{"timestamp":"2026-07-01T13:30:21.277086500Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Serialize build instructions\",\"depth\":2,\"durationTicks\":594307}"} +{"timestamp":"2026-07-01T13:30:21.277101800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Generate build instructions\",\"depth\":1,\"durationTicks\":597693}"} +{"timestamp":"2026-07-01T13:30:21.277130400Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Execute instructions\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.277490700Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Precompile Shaders\",\"depth\":2}"} +{"timestamp":"2026-07-01T13:30:21.278192100Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Precompile Shaders\",\"depth\":2,\"durationTicks\":6941}"} +{"timestamp":"2026-07-01T13:30:21.278214600Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Write serialized files\",\"depth\":2}"} +{"timestamp":"2026-07-01T13:30:21.329011800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Write serialized files\",\"depth\":2,\"durationTicks\":507796}"} +{"timestamp":"2026-07-01T13:30:21.329030100Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Execute instructions\",\"depth\":1,\"durationTicks\":519034}"} +{"timestamp":"2026-07-01T13:30:21.329610000Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Generate build manifest\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.330155000Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Generate build manifest\",\"depth\":1,\"durationTicks\":5541}"} +{"timestamp":"2026-07-01T13:30:21.341669500Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"BuildStatistic\",\"context\":\"BuildOutput\",\"statistics\":[{\"name\":\"sizeReusedContentInOutputDirectory\",\"value\":0,\"unit\":\"bytes\"},{\"name\":\"sizeWrittenToOutputDirectory\",\"value\":94871,\"unit\":\"bytes\"},{\"name\":\"filesReusedInOutputDirectory\",\"value\":0,\"unit\":\"count\"},{\"name\":\"filesWrittenToOutputDirectory\",\"value\":10,\"unit\":\"count\"}]}"} +{"timestamp":"2026-07-01T13:30:21.341720700Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Clean output directory\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.342367200Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Clean output directory\",\"depth\":1,\"durationTicks\":6447}"} +{"timestamp":"2026-07-01T13:30:21.342751800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Populate build report\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.344712800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Populate build report\",\"depth\":1,\"durationTicks\":19726}"} +{"timestamp":"2026-07-01T13:30:21.344740900Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Record type usage\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.349631800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Record type usage\",\"depth\":1,\"durationTicks\":48639}"} +{"timestamp":"2026-07-01T13:30:21.349660100Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Generate build layout\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.350491400Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Generate build layout\",\"depth\":1,\"durationTicks\":8167}"} +{"timestamp":"2026-07-01T13:30:21.350522000Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"BuildStatistic\",\"context\":\"BuildComplete\",\"statistics\":[{\"name\":\"loadableCount\",\"value\":3,\"unit\":\"count\"},{\"name\":\"objectsProcessed\",\"value\":18,\"unit\":\"count\"},{\"name\":\"objectsBuilt\",\"value\":9,\"unit\":\"count\"},{\"name\":\"scenesBuilt\",\"value\":0,\"unit\":\"count\"},{\"name\":\"serializedFilesBuilt\",\"value\":7,\"unit\":\"count\"},{\"name\":\"archivesBuilt\",\"value\":0,\"unit\":\"count\"},{\"name\":\"serializedFilesReused\",\"value\":0,\"unit\":\"count\"},{\"name\":\"serializedFilesRebuilt\",\"value\":7,\"unit\":\"count\"},{\"name\":\"reusedSerializedFileSize\",\"value\":0,\"unit\":\"bytes\"},{\"name\":\"rebuiltSerializedFileSize\",\"value\":15056,\"unit\":\"bytes\"}]}"} +{"timestamp":"2026-07-01T13:30:21.350693800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Finalize ContentBuildRoot\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.351035300Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Finalize ContentBuildRoot\",\"depth\":1,\"durationTicks\":3449}"} +{"timestamp":"2026-07-01T13:30:21.351058400Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Clean up after build\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.357506400Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Clean up after build\",\"depth\":1,\"durationTicks\":64244}"} +{"timestamp":"2026-07-01T13:30:21.357529300Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Unloading unused assets\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.367405800Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Unloading unused assets\",\"depth\":1,\"durationTicks\":98396}"} +{"timestamp":"2026-07-01T13:30:21.370297500Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepStart\",\"stepName\":\"Call Post-Process callbacks\",\"depth\":1}"} +{"timestamp":"2026-07-01T13:30:21.371202600Z","thread_id":"27228","log_level":"Info","message":"{\"type\":\"StepEnd\",\"stepName\":\"Call Post-Process callbacks\",\"depth\":1,\"durationTicks\":9113}"} diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildReportSummary.json b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildReportSummary.json new file mode 100644 index 0000000..a438df9 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/BuildReportSummary.json @@ -0,0 +1,27 @@ +{ + "Version": 2, + "BuildContentOptions": [ + "CleanBuildCache" + ], + "BuildManifestHash": "15d5df98d98434e67e06716cfabfad1b", + "BuildName": "ContentDirectory", + "BuildOptions": [ + "None" + ], + "BuildProfilePath": "", + "BuildResult": 1, + "BuildResultName": "Succeeded", + "BuildSessionGUID": "2e3fcc980d14c6a498d140ac0a24af65", + "BuildStartedAt": "2026-07-01T13:30:16.2564912Z", + "BuildType": 3, + "BuildTypeName": "ContentDirectory", + "OutputPath": "C:/UnitySrc/UnityDataTools/UnityProjects/LeadingEdge/../../TestCommon/Data/LeadingEdgeBuilds/ContentDirectory", + "Platform": 19, + "PlatformName": "StandaloneWindows64", + "Subtarget": 2, + "SubtargetName": "Player", + "TotalErrors": 0, + "TotalSizeBytes": 94903, + "TotalTimeMs": 5127, + "TotalWarnings": 0 +} \ No newline at end of file diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentLayout.json b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentLayout.json new file mode 100644 index 0000000..6548a67 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentLayout.json @@ -0,0 +1 @@ +{"Version":1,"BuildManifestHash":"15d5df98d98434e67e06716cfabfad1b","SerializedFiles":[{"Index":0,"ID":"Library/unity default resources","IsBuiltIn":true,"SourceAssets":[],"LoadableDependencies":[],"LoadableSceneDependencies":[],"SerializedFileDependencies":[]},{"Index":1,"ID":"20408785117e138f38c2cc4ca0e638c8.cfid","IsBuiltIn":false,"SourceAssets":["Assets/Audio/6.mp3"],"LoadableDependencies":[],"LoadableSceneDependencies":[],"SerializedFileDependencies":[],"ContentHash":"93bb3159569284a5c7bcceb4acb91bae"},{"Index":2,"ID":"4038ff673d390134d924b57fcbed0432.cfid","IsBuiltIn":false,"SourceAssets":["Assets/ScriptableObjects/LoadableAudioClipReference.asset"],"LoadableDependencies":["20408785117e138f38c2cc4ca0e638c8","dd30e3af3b8bddf1ea36d768fc41aafd"],"LoadableSceneDependencies":[],"SerializedFileDependencies":[4],"ContentHash":"bfcf18a244e45f867750e0223a9b3a43"},{"Index":3,"ID":"52b43dad178849b42ac753005736e7bb.cfid","IsBuiltIn":false,"SourceAssets":["Assets/ScriptableObjects/ContentDirectoryRoot.asset"],"LoadableDependencies":[],"LoadableSceneDependencies":[],"SerializedFileDependencies":[4,2,6,7],"ContentHash":"a77f98db89b6aa1aeaaad01d857e5115"},{"Index":4,"ID":"a2a42d71dddef12e8889849faf59bdd7.cfid","IsBuiltIn":false,"SourceAssets":["Assets/Scripts/DirectScriptableObjectReference.cs","Assets/Scripts/LoadableAudioClipReference.cs","Assets/Scripts/SerializationDemo.cs"],"LoadableDependencies":[],"LoadableSceneDependencies":[],"SerializedFileDependencies":[],"ContentHash":"dfa73a08ed0fba634f160c6d26a5e830"},{"Index":5,"ID":"dd30e3af3b8bddf1ea36d768fc41aafd.cfid","IsBuiltIn":false,"SourceAssets":["Assets/Audio/a.mp3"],"LoadableDependencies":[],"LoadableSceneDependencies":[],"SerializedFileDependencies":[],"ContentHash":"730d2d641a53eeb1e633f2ff60d730e9"},{"Index":6,"ID":"21679be819d6e9146a63bb02a7e51f2f.cfid","IsBuiltIn":false,"SourceAssets":["Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset"],"LoadableDependencies":["dd30e3af3b8bddf1ea36d768fc41aafd"],"LoadableSceneDependencies":[],"SerializedFileDependencies":[4],"ContentHash":"5c43454a3823f172a2a326410a36ba6b"},{"Index":7,"ID":"78532141fd7679a458405eb16bdb75fd.cfid","IsBuiltIn":false,"SourceAssets":["Assets/ScriptableObjects/SerializationDemo.asset"],"LoadableDependencies":[],"LoadableSceneDependencies":[],"SerializedFileDependencies":[4],"ContentHash":"51690f09f541d7442ce8faf26fd84696"}],"RootAssets":["3dcb957e6cb206bfec2aaadd3d11d85c"],"LoadableObjectIds":[{"ObjectIdHash":"20408785117e138f38c2cc4ca0e638c8","GUID":"278c261333bf8604eb5c83790d02004d","AssetPath":"Assets/Audio/6.mp3","LFID":8300000,"IdentifierType":3,"SerializedFile":1},{"ObjectIdHash":"3dcb957e6cb206bfec2aaadd3d11d85c","GUID":"52b43dad178849b42ac753005736e7bb","AssetPath":"Assets/ScriptableObjects/ContentDirectoryRoot.asset","LFID":11400000,"IdentifierType":2,"SerializedFile":3},{"ObjectIdHash":"dd30e3af3b8bddf1ea36d768fc41aafd","GUID":"b65a7916245593b4e89f4bd0aa920533","AssetPath":"Assets/Audio/a.mp3","LFID":8300000,"IdentifierType":3,"SerializedFile":5}],"LoadableSceneIds":[],"BinaryArtifacts":[{"Index":0,"ContentHash":"93bb3159569284a5c7bcceb4acb91bae","Category":"contentfile","Size":1288,"ArtifactReferences":[1]},{"Index":1,"ContentHash":"68c9d0b12420e1951eec7790bd0754fe","Category":"audio","Size":30688},{"Index":2,"ContentHash":"bfcf18a244e45f867750e0223a9b3a43","Category":"contentfile","Size":2184},{"Index":3,"ContentHash":"a77f98db89b6aa1aeaaad01d857e5115","Category":"contentfile","Size":1448},{"Index":4,"ContentHash":"dfa73a08ed0fba634f160c6d26a5e830","Category":"contentfile","Size":1900},{"Index":5,"ContentHash":"730d2d641a53eeb1e633f2ff60d730e9","Category":"contentfile","Size":1288,"ArtifactReferences":[6]},{"Index":6,"ContentHash":"4226b5c16a50dab6eff0f08dd1253d4b","Category":"audio","Size":47424},{"Index":7,"ContentHash":"5c43454a3823f172a2a326410a36ba6b","Category":"contentfile","Size":2136},{"Index":8,"ContentHash":"51690f09f541d7442ce8faf26fd84696","Category":"contentfile","Size":4812},{"Index":9,"ContentHash":"15d5df98d98434e67e06716cfabfad1b","Category":"manifest","Size":1703,"ArtifactReferences":[0,2,3,4,5,7,8]}]} \ No newline at end of file diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentSizeSummary.txt b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentSizeSummary.txt new file mode 100644 index 0000000..e30800b --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ContentSizeSummary.txt @@ -0,0 +1,19 @@ +------------------------------------------------------------------------------- +Build Report - Content Size Statistics +Serialized File count 7 +Resource file count 2 +Object count 9 +Serialized Files 14.7 kb 16.2% +Serialized Files Headers 11.5 kb 12.6% +Resource data (Texture,Audio...) 76.3 kb 83.8% +Total build size 91.0 kb + +Largest Types: + 76.5 kb 84.1% AudioClip + 2.7 kb 3.0% MonoBehaviour + +Largest Assets: + 46.4 kb 51.0% Assets/Audio/a.mp3 + 30.1 kb 33.0% Assets/Audio/6.mp3 + 2.2 kb 2.5% Assets/ScriptableObjects/SerializationDemo.asset +------------------------------------------------------------------------------- diff --git a/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ScriptsOnlyCache.yaml b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ScriptsOnlyCache.yaml new file mode 100644 index 0000000..30f509a --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/BuildReport-ContentDirectory/ScriptsOnlyCache.yaml @@ -0,0 +1,21 @@ +ScriptsOnlyBuild: + usedScripts: + Assembly-CSharp.dll: + - DirectScriptableObjectReference + - LoadableAudioClipReference + - SerializationDemo + serializedClasses: + Assembly-CSharp: + - SerializationDemo/SerializedData + UnityEngine.ContentLoadModule: + - Unity.Loading.Loadable`1 + UnityEngine.CoreModule: + - Unity.Loading.LoadableObjectId + - UnityEngine.DictionarySerialization/SerializedKeyValue`2 + methodsToPreserve: [] + sceneClasses: {} + scriptHashData: [] + platform: 19 + scenePathNames: [] + nativeClasses: 000000001200000082000000530000007de237150f0100000200000072000000080000003100000073000000i + playerPath: diff --git a/TestCommon/Data/LeadingEdgeBuilds/CLAUDE.md b/TestCommon/Data/LeadingEdgeBuilds/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/15d5df98d98434e67e06716cfabfad1b.json b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/15d5df98d98434e67e06716cfabfad1b.json new file mode 100644 index 0000000..70f5fdd --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/15d5df98d98434e67e06716cfabfad1b.json @@ -0,0 +1 @@ +{"Version":1,"BuildInfo":{"BuildName":"ContentDirectory","BuiltWithTypeTrees":true},"RootAssets":["3dcb957e6cb206bfec2aaadd3d11d85c"],"Loadables":[{"ObjectIdHash":"20408785117e138f38c2cc4ca0e638c8","SerializedFile":1,"Identifier":6313987888022012634},{"ObjectIdHash":"3dcb957e6cb206bfec2aaadd3d11d85c","SerializedFile":3,"Identifier":-775554941117088049},{"ObjectIdHash":"dd30e3af3b8bddf1ea36d768fc41aafd","SerializedFile":5,"Identifier":-6933612096100796476}],"LoadableScenes":[],"SerializedFiles":[{"Index":0,"ID":"Library/unity default resources","IsBuiltIn":true,"SerializedFileDependencies":[]},{"Index":1,"ID":"20408785117e138f38c2cc4ca0e638c8.cfid","IsBuiltIn":false,"SerializedFileDependencies":[],"ContentHash":"93bb3159569284a5c7bcceb4acb91bae"},{"Index":2,"ID":"4038ff673d390134d924b57fcbed0432.cfid","IsBuiltIn":false,"SerializedFileDependencies":[4],"ContentHash":"bfcf18a244e45f867750e0223a9b3a43"},{"Index":3,"ID":"52b43dad178849b42ac753005736e7bb.cfid","IsBuiltIn":false,"SerializedFileDependencies":[4,2,6,7],"ContentHash":"a77f98db89b6aa1aeaaad01d857e5115"},{"Index":4,"ID":"a2a42d71dddef12e8889849faf59bdd7.cfid","IsBuiltIn":false,"SerializedFileDependencies":[],"ContentHash":"dfa73a08ed0fba634f160c6d26a5e830"},{"Index":5,"ID":"dd30e3af3b8bddf1ea36d768fc41aafd.cfid","IsBuiltIn":false,"SerializedFileDependencies":[],"ContentHash":"730d2d641a53eeb1e633f2ff60d730e9"},{"Index":6,"ID":"21679be819d6e9146a63bb02a7e51f2f.cfid","IsBuiltIn":false,"SerializedFileDependencies":[4],"ContentHash":"5c43454a3823f172a2a326410a36ba6b"},{"Index":7,"ID":"78532141fd7679a458405eb16bdb75fd.cfid","IsBuiltIn":false,"SerializedFileDependencies":[4],"ContentHash":"51690f09f541d7442ce8faf26fd84696"}]} \ No newline at end of file diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/4226b5c16a50dab6eff0f08dd1253d4b.resource b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/4226b5c16a50dab6eff0f08dd1253d4b.resource new file mode 100644 index 0000000..3a4d2c7 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/4226b5c16a50dab6eff0f08dd1253d4b.resource differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/51690f09f541d7442ce8faf26fd84696.cf b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/51690f09f541d7442ce8faf26fd84696.cf new file mode 100644 index 0000000..e82c8f4 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/51690f09f541d7442ce8faf26fd84696.cf differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/5c43454a3823f172a2a326410a36ba6b.cf b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/5c43454a3823f172a2a326410a36ba6b.cf new file mode 100644 index 0000000..98b2c87 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/5c43454a3823f172a2a326410a36ba6b.cf differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/68c9d0b12420e1951eec7790bd0754fe.resource b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/68c9d0b12420e1951eec7790bd0754fe.resource new file mode 100644 index 0000000..5db4c60 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/68c9d0b12420e1951eec7790bd0754fe.resource differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/730d2d641a53eeb1e633f2ff60d730e9.cf b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/730d2d641a53eeb1e633f2ff60d730e9.cf new file mode 100644 index 0000000..37c0390 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/730d2d641a53eeb1e633f2ff60d730e9.cf differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/93bb3159569284a5c7bcceb4acb91bae.cf b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/93bb3159569284a5c7bcceb4acb91bae.cf new file mode 100644 index 0000000..df31167 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/93bb3159569284a5c7bcceb4acb91bae.cf differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/BuildManifestHash.txt b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/BuildManifestHash.txt new file mode 100644 index 0000000..5a2a338 --- /dev/null +++ b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/BuildManifestHash.txt @@ -0,0 +1 @@ +15d5df98d98434e67e06716cfabfad1b \ No newline at end of file diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/a77f98db89b6aa1aeaaad01d857e5115.cf b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/a77f98db89b6aa1aeaaad01d857e5115.cf new file mode 100644 index 0000000..efd76e0 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/a77f98db89b6aa1aeaaad01d857e5115.cf differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/bfcf18a244e45f867750e0223a9b3a43.cf b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/bfcf18a244e45f867750e0223a9b3a43.cf new file mode 100644 index 0000000..85cf1da Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/bfcf18a244e45f867750e0223a9b3a43.cf differ diff --git a/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/dfa73a08ed0fba634f160c6d26a5e830.cf b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/dfa73a08ed0fba634f160c6d26a5e830.cf new file mode 100644 index 0000000..e87bbb4 Binary files /dev/null and b/TestCommon/Data/LeadingEdgeBuilds/ContentDirectory/dfa73a08ed0fba634f160c6d26a5e830.cf differ diff --git a/TestCommon/Data/PlayerData/AGENTS.md b/TestCommon/Data/PlayerData/AGENTS.md new file mode 100644 index 0000000..9d9d60f --- /dev/null +++ b/TestCommon/Data/PlayerData/AGENTS.md @@ -0,0 +1,5 @@ +# PlayerData test data + +Player build output used by the UnityDataTools test suites, kept in a subfolder per Unity version (e.g. `2022.1.20f1`). Each holds the serialized `level0` scene file and its `.resS` streaming resource. + +Generated by the `UnityProjects/Baseline` project - run **Tools > Generate PlayerData** there (builds a player from `OtherScene.unity` and copies `level0` here under the Unity version). This requires the `ForceAlwaysWriteTypeTrees` diagnostic switch to be enabled. See that project's `AGENTS.md`. diff --git a/TestCommon/Data/PlayerData/CLAUDE.md b/TestCommon/Data/PlayerData/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/TestCommon/Data/PlayerData/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/UnityDataTool.Tests/DumpTests.cs b/UnityDataTool.Tests/DumpTests.cs index a809eb9..a813d49 100644 --- a/UnityDataTool.Tests/DumpTests.cs +++ b/UnityDataTool.Tests/DumpTests.cs @@ -15,6 +15,7 @@ public class DumpTests private string m_MultiSerializedFileArchivePath; private string m_NoTypeTreeSerializedFilePath; private string m_NoTypeTreeArchivePath; + private string m_SerializationDemoBundlePath; [OneTimeSetUp] public void OneTimeSetup() @@ -25,6 +26,7 @@ public void OneTimeSetup() m_MultiSerializedFileArchivePath = Path.Combine(m_TestDataFolder, "PlayerDataCompressed", "data.unity3d"); m_NoTypeTreeSerializedFilePath = Path.Combine(m_TestDataFolder, "PlayerNoTypeTree", "level0"); m_NoTypeTreeArchivePath = Path.Combine(m_TestDataFolder, "AssetBundleTypeTreeVariations", "AssetBundle-NoTypeTree", "small.bundle"); + m_SerializationDemoBundlePath = Path.Combine(m_TestDataFolder, "LeadingEdgeBuilds", "AssetBundles", "serializationdemo"); } [Test] @@ -259,4 +261,52 @@ public async Task Dump_NoTypeTreeArchive_ReportsMissingTypeTreesWithoutCrashing( Assert.That(output, Does.Contain("has no TypeTrees"), "Expected a clear missing-TypeTrees message"); Assert.That(output, Does.Not.Contain("SerializedFileOpenException"), "Should not leak an exception/stack trace"); } + + // Dumps the SerializationDemo ScriptableObject from the LeadingEdge AssetBundle build and confirms the + // serialized field layout and default values (see UnityProjects/LeadingEdge/Assets/Scripts/SerializationDemo.cs). + // Uses substring checks against the pseudo-YAML text output; once JSON output is supported this can parse and + // assert more precisely. + [Test] + public async Task Dump_Stdout_AssetBundle_SerializationDemo_ContainsExpectedFields() + { + using var sw = new StringWriter(); + var currentOut = Console.Out; + try + { + Console.SetOut(sw); + Assert.AreEqual(0, await Program.Main(new string[] { "dump", m_SerializationDemoBundlePath, "--stdout", "--type", "MonoBehaviour" })); + } + finally + { + Console.SetOut(currentOut); + } + + var output = sw.ToString(); + + // The MonoBehaviour (ScriptableObject) and its SerializeReference-held data object. + Assert.That(output, Does.Contain("(ClassID: 114) MonoBehaviour")); + Assert.That(output, Does.Contain("m_Name (string) SerializationDemo")); + Assert.That(output, Does.Contain("data (managedReference)")); + Assert.That(output, Does.Contain("references (ManagedReferencesRegistry)")); + Assert.That(output, Does.Contain("class (string) SerializationDemo/SerializedData")); + + // Scalar fields: name, serialized type and value. + Assert.That(output, Does.Contain("longValue (SInt64) -1234567890123456789")); + Assert.That(output, Does.Contain("ulongValue (UInt64) 12345678901234567890")); + Assert.That(output, Does.Contain("intValue (int) -2000000000")); + Assert.That(output, Does.Contain("uintValue (unsigned int) 4000000000")); + Assert.That(output, Does.Contain("shortValue (SInt16) -12345")); + Assert.That(output, Does.Contain("ushortValue (UInt16) 54321")); + Assert.That(output, Does.Contain("signedCharValue (SInt8) -123")); + Assert.That(output, Does.Contain("unsignedCharValue (UInt8) 234")); + Assert.That(output, Does.Contain("boolValue (UInt8) 1")); + Assert.That(output, Does.Contain("floatValue (float) 3.1415927")); + Assert.That(output, Does.Contain("doubleValue (double) 2.718281828459045")); + Assert.That(output, Does.Contain("charValue (UInt16) 90")); + Assert.That(output, Does.Contain("stringValue (string) SerializationDemo string value")); + + // Int array of 512 values (0..511). Check the header and a slice of the sequence. + Assert.That(output, Does.Contain("Array[512]")); + Assert.That(output, Does.Contain("293, 294, 295, 296,")); + } } diff --git a/UnityDataTool.Tests/ExpectedDataGenerator.cs b/UnityDataTool.Tests/ExpectedDataGenerator.cs index 77707c2..4963acf 100644 --- a/UnityDataTool.Tests/ExpectedDataGenerator.cs +++ b/UnityDataTool.Tests/ExpectedDataGenerator.cs @@ -30,8 +30,7 @@ public static void Generate(Context context) Program.Main(new string[] { "analyze", Path.Combine(context.UnityDataFolder), "-r" }); - using var db = new SqliteConnection($"Data Source={Path.Combine(Directory.GetCurrentDirectory(), "database.db")};Version=3;New=True;Foreign Keys=False;"); - db.Open(); + using var db = SQLTestHelper.OpenDatabase(Path.Combine(Directory.GetCurrentDirectory(), "database.db")); using (var cmd = db.CreateCommand()) { diff --git a/UnityDataTool.Tests/FindRefsTests.cs b/UnityDataTool.Tests/FindRefsTests.cs new file mode 100644 index 0000000..efc6b70 --- /dev/null +++ b/UnityDataTool.Tests/FindRefsTests.cs @@ -0,0 +1,315 @@ +using System; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Microsoft.Data.Sqlite; +using NUnit.Framework; + +namespace UnityDataTools.UnityDataTool.Tests; + +#pragma warning disable NUnit2005, NUnit2006 + +// Tests for the "find-refs" command, which traces reference chains from assets to a target object using the +// refs/object_view data produced by "analyze". They run against the LeadingEdge AssetBundle build output, which has +// well-known relationships (see UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs): +// +// AssetBundleRoot (DirectScriptableObjectReference) +// -> DirectAudioClipReference references AudioClips "a" and "6" +// -> SingleAudioClipDirectReference references AudioClip "a" only +// -> SerializationDemo +// +// So AudioClip "a" is referenced by two assets and "6" by one, giving deterministic chain counts to assert on. +public class FindRefsTests +{ + private string m_AssetBundlesPath; + private string m_WorkFolder; + private string m_DatabasePath; + private string m_NoRefsDatabasePath; + + [OneTimeSetUp] + public async Task OneTimeSetup() + { + var testDataFolder = Path.Combine(TestContext.CurrentContext.TestDirectory, "Data"); + m_AssetBundlesPath = Path.Combine(testDataFolder, "LeadingEdgeBuilds", "AssetBundles"); + + m_WorkFolder = Path.Combine(TestContext.CurrentContext.TestDirectory, "findrefs_test_folder"); + Directory.CreateDirectory(m_WorkFolder); + + m_DatabasePath = Path.Combine(m_WorkFolder, "refs.db"); + m_NoRefsDatabasePath = Path.Combine(m_WorkFolder, "norefs.db"); + + // A database with references (used by most tests) and one built with --skip-references (empty refs table). + Assert.AreEqual(0, await Program.Main(new[] { "analyze", m_AssetBundlesPath, "-o", m_DatabasePath }), + "analyze should succeed on the LeadingEdge AssetBundle build"); + Assert.AreEqual(0, await Program.Main(new[] { "analyze", m_AssetBundlesPath, "-o", m_NoRefsDatabasePath, "-s" }), + "analyze --skip-references should succeed"); + } + + [OneTimeTearDown] + public void OneTimeTeardown() + { + SqliteConnection.ClearAllPools(); + try + { + Directory.Delete(m_WorkFolder, true); + } + catch (Exception) + { + // Best effort cleanup; leftover files in the test output folder are harmless. + } + } + + // Runs find-refs with --stdout and captures everything it writes (both the reference chains and messages such as + // "No object found!"), returning the exit code and the combined output. + private async Task<(int exitCode, string output)> RunFindRefs(params string[] args) + { + return await RunFindRefsOn(m_DatabasePath, args); + } + + private static async Task<(int exitCode, string output)> RunFindRefsOn(string databasePath, string[] args) + { + using var sw = new StringWriter(); + var currentOut = Console.Out; + int exitCode; + try + { + Console.SetOut(sw); + var fullArgs = new string[args.Length + 3]; + fullArgs[0] = "find-refs"; + fullArgs[1] = databasePath; + Array.Copy(args, 0, fullArgs, 2, args.Length); + fullArgs[args.Length + 2] = "--stdout"; + exitCode = await Program.Main(fullArgs); + } + finally + { + Console.SetOut(currentOut); + } + + return (exitCode, sw.ToString()); + } + + // Regression test for issue #72: the command previously threw "Connection string keyword 'version' is not + // supported" when opening any analyze database. + [Test] + public async Task FindRefs_OpensAnalyzeDatabase_WithoutConnectionStringError() + { + var (exitCode, output) = await RunFindRefs("-n", "a", "-t", "AudioClip"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Not.Contain("Error opening database")); + Assert.That(output, Does.Contain("Reference chains to a")); + } + + [Test] + public async Task FindRefs_ByName_AudioClipSharedByTwoAssets_FindsBothChains() + { + var (exitCode, output) = await RunFindRefs("-n", "a", "-t", "AudioClip"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("Type: AudioClip")); + Assert.That(output, Does.Contain("Found 2 reference chain(s).")); + + // Both referencing assets and a dictionary value property path appear. + Assert.That(output, Does.Contain("DirectAudioClipReference")); + Assert.That(output, Does.Contain("SingleAudioClipDirectReference")); + Assert.That(output, Does.Contain(".value")); + } + + [Test] + public async Task FindRefs_ByName_AudioClipReferencedOnce_FindsOneChain() + { + var (exitCode, output) = await RunFindRefs("-n", "6", "-t", "AudioClip"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("Found 1 reference chain(s).")); + Assert.That(output, Does.Contain("DirectAudioClipReference")); + Assert.That(output, Does.Not.Contain("SingleAudioClipDirectReference")); + } + + // "SerializationDemo" is the name of both a MonoBehaviour (the ScriptableObject) and its MonoScript, so searching + // by name alone matches two objects while adding the type narrows it to one. + [Test] + public async Task FindRefs_ByNameOnly_MatchesMonoBehaviourAndMonoScript() + { + var (exitCode, output) = await RunFindRefs("-n", "SerializationDemo"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("Type: MonoBehaviour")); + Assert.That(output, Does.Contain("Type: MonoScript")); + } + + [Test] + public async Task FindRefs_ByNameAndType_NarrowsToSingleObject() + { + var (exitCode, output) = await RunFindRefs("-n", "SerializationDemo", "-t", "MonoBehaviour"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("Type: MonoBehaviour")); + Assert.That(output, Does.Not.Contain("Type: MonoScript")); + // Referenced from the AssetBundleRoot aggregator. + Assert.That(output, Does.Contain("AssetBundleRoot")); + } + + // ScriptableObjects are MonoBehaviours whose m_GameObject PPtr is 0; the chain output must render them without + // throwing on the NULL game_object/script subquery results (a bug found while adding this coverage). + [Test] + public async Task FindRefs_ScriptableObjectChain_RendersScriptAndNoGameObject() + { + var (exitCode, output) = await RunFindRefs("-n", "a", "-t", "AudioClip"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("[Script = DirectAudioClipReference]")); + Assert.That(output, Does.Not.Contain("[Component of")); + } + + // find-refs reports the immediate containing asset and stops there, so searching for a leaf ScriptableObject + // asset surfaces AssetBundleRoot (which references it) as a one-hop chain. + [Test] + public async Task FindRefs_LeafAsset_ReachesAssetBundleRoot() + { + var (exitCode, output) = await RunFindRefs("-n", "DirectAudioClipReference", "-t", "MonoBehaviour"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("Found 1 reference chain(s).")); + Assert.That(output, Does.Contain("AssetBundleRoot")); + Assert.That(output, Does.Contain("[Script = DirectScriptableObjectReference]")); + Assert.That(output, Does.Contain("references.Array")); + } + + // The traversal stops at the first asset reached going up the graph. AudioClip "a" is referenced directly by the + // leaf ScriptableObjects, which are themselves assets, so the chains stop there and never reach AssetBundleRoot + // further up (even though AssetBundleRoot transitively depends on the clip). + [Test] + public async Task FindRefs_AudioClip_StopsAtLeafAsset_DoesNotReachAssetBundleRoot() + { + var (exitCode, output) = await RunFindRefs("-n", "a", "-t", "AudioClip"); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("DirectAudioClipReference")); + Assert.That(output, Does.Not.Contain("AssetBundleRoot")); + } + + [Test] + public async Task FindRefs_ByObjectId_ProducesSameChainsAsByName() + { + // Look up the AudioClip "a" id, then confirm find-refs -i yields the same chains as find-refs -n. + long audioClipId; + using (var db = SQLTestHelper.OpenDatabase(m_DatabasePath)) + { + audioClipId = QueryLong(db, "SELECT id FROM object_view WHERE name = 'a' AND type = 'AudioClip'"); + } + + var (exitCode, output) = await RunFindRefs("-i", audioClipId.ToString()); + + Assert.AreEqual(0, exitCode); + Assert.That(output, Does.Contain("Reference chains to a")); + Assert.That(output, Does.Contain("Found 2 reference chain(s).")); + } + + // --find-all only differs from the default when a single asset reaches the target via more than one property path. + // In this test data the only such multi-path references come from AssetBundle bookkeeping objects (m_PreloadTable + // plus m_Container), which are dropped because they are neither assets nor referenced by anything - so the + // reference chains are identical and only the "Analyzed N object(s)" counter differs. + [Test] + public async Task FindRefs_FindAll_ProducesSameChainsAsDefault() + { + var (defExit, defOut) = await RunFindRefs("-n", "a", "-t", "AudioClip"); + var (allExit, allOut) = await RunFindRefs("-n", "a", "-t", "AudioClip", "-a"); + + Assert.AreEqual(0, defExit); + Assert.AreEqual(0, allExit); + Assert.That(allOut, Does.Contain("Found 2 reference chain(s).")); + + string StripAnalyzedCount(string s) => Regex.Replace(s, @"Analyzed \d+ object\(s\)\.", "Analyzed N object(s)."); + Assert.AreEqual(StripAnalyzedCount(defOut), StripAnalyzedCount(allOut), + "find-all should produce the same chains as the default for this data"); + } + + [Test] + public async Task FindRefs_NonExistentObject_ReportsNotFound() + { + var (exitCode, output) = await RunFindRefs("-n", "ThisObjectDoesNotExist"); + + Assert.AreNotEqual(0, exitCode); + Assert.That(output, Does.Contain("No object found!")); + } + + [Test] + public async Task FindRefs_SkipReferencesDatabase_ReportsEmptyRefsTable() + { + var (exitCode, output) = await RunFindRefsOn(m_NoRefsDatabasePath, new[] { "-n", "a", "-t", "AudioClip" }); + + Assert.AreNotEqual(0, exitCode); + Assert.That(output, Does.Contain("'refs' table empty")); + } + + [Test] + public async Task FindRefs_StdoutAndOutputFile_MutuallyExclusive() + { + using var swOut = new StringWriter(); + using var swErr = new StringWriter(); + var currentOut = Console.Out; + var currentErr = Console.Error; + int exitCode; + try + { + Console.SetOut(swOut); + Console.SetError(swErr); + exitCode = await Program.Main(new[] + { "find-refs", m_DatabasePath, "-n", "a", "-t", "AudioClip", "--stdout", "-o", "refs.txt" }); + } + finally + { + Console.SetOut(currentOut); + Console.SetError(currentErr); + } + + Assert.AreNotEqual(0, exitCode); + Assert.That(swErr.ToString(), Does.Contain("--stdout and -o/--output-file are mutually exclusive.")); + } + + // Direct checks against the refs/object_view data structures that find-refs depends on, independent of the + // command's output formatting. The refs table also holds AssetBundle bookkeeping references (m_PreloadTable, + // m_Container), so counting the asset references means restricting to the MonoBehaviour (ScriptableObject) + // referrers - which is what find-refs reports as chains. + [Test] + public void RefsTable_AudioClipReferenceCounts_MatchKnownRelationships() + { + using var db = SQLTestHelper.OpenDatabase(m_DatabasePath); + + var aId = QueryLong(db, "SELECT id FROM object_view WHERE name = 'a' AND type = 'AudioClip'"); + var sixId = QueryLong(db, "SELECT id FROM object_view WHERE name = '6' AND type = 'AudioClip'"); + + SQLTestHelper.AssertQueryInt(db, + $@"SELECT COUNT(*) FROM refs r JOIN object_view ov ON ov.id = r.object + WHERE r.referenced_object = {aId} AND ov.type = 'MonoBehaviour'", 2, + "AudioClip 'a' should be referenced by two ScriptableObjects"); + SQLTestHelper.AssertQueryInt(db, + $@"SELECT COUNT(*) FROM refs r JOIN object_view ov ON ov.id = r.object + WHERE r.referenced_object = {sixId} AND ov.type = 'MonoBehaviour'", 1, + "AudioClip '6' should be referenced by one ScriptableObject"); + } + + [Test] + public void RefsTable_DirectAudioClipReference_ReferencesBothClips() + { + using var db = SQLTestHelper.OpenDatabase(m_DatabasePath); + + // The DirectAudioClipReference asset references both AudioClips. + var count = SQLTestHelper.QueryInt(db, @" + SELECT COUNT(*) FROM refs + WHERE object = (SELECT id FROM object_view WHERE name = 'DirectAudioClipReference' AND type = 'MonoBehaviour') + AND referenced_object IN (SELECT id FROM object_view WHERE type = 'AudioClip')"); + Assert.AreEqual(2, count, "DirectAudioClipReference should reference both AudioClips"); + } + + private static long QueryLong(SqliteConnection db, string sql) + { + using var cmd = db.CreateCommand(); + cmd.CommandText = sql; + using var reader = cmd.ExecuteReader(); + Assert.IsTrue(reader.Read(), $"Query returned no rows: {sql}"); + return reader.GetInt64(0); + } +} diff --git a/UnityDataTool/Program.cs b/UnityDataTool/Program.cs index e9eb127..c8e0794 100644 --- a/UnityDataTool/Program.cs +++ b/UnityDataTool/Program.cs @@ -129,6 +129,7 @@ static Command BuildFindRefsCommand() var nOpt = new Option(aliases: new[] { "--object-name", "-n" }, description: "Object name"); var tOpt = new Option(aliases: new[] { "--object-type", "-t" }, description: "Optional object type when searching by name"); var aOpt = new Option(aliases: new[] { "--find-all", "-a" }, description: "Find all reference chains originating from the same asset (instead of only one), can be very slow"); + var stdoutOpt = new Option(aliases: new[] { "--stdout" }, description: "Write the reference chains to stdout instead of a file."); var findRefsCommand = new Command("find-refs", "Find reference chains to specified object(s).") { @@ -138,11 +139,23 @@ static Command BuildFindRefsCommand() nOpt, tOpt, iOpt, + stdoutOpt, }; + findRefsCommand.AddValidator(commandResult => + { + var stdoutResult = commandResult.FindResultFor(stdoutOpt); + var oResult = commandResult.FindResultFor(oOpt); + bool stdoutSet = stdoutResult is { IsImplicit: false }; + bool oExplicit = oResult is { IsImplicit: false }; + if (stdoutSet && oExplicit) + { + commandResult.ErrorMessage = "--stdout and -o/--output-file are mutually exclusive."; + } + }); findRefsCommand.SetHandler( - (FileInfo fi, string o, long? i, string n, string t, bool a) => Task.FromResult(HandleFindReferences(fi, o, i, n, t, a)), - pathArg, oOpt, iOpt, nOpt, tOpt, aOpt); + (FileInfo fi, string o, long? i, string n, string t, bool a, bool toStdout) => Task.FromResult(HandleFindReferences(fi, o, i, n, t, a, toStdout)), + pathArg, oOpt, iOpt, nOpt, tOpt, aOpt, stdoutOpt); return findRefsCommand; } @@ -366,7 +379,7 @@ static int HandleAnalyze( }); } - static int HandleFindReferences(FileInfo databasePath, string outputFile, long? objectId, string objectName, string objectType, bool findAll) + static int HandleFindReferences(FileInfo databasePath, string outputFile, long? objectId, string objectName, string objectType, bool findAll, bool toStdout) { var finder = new ReferenceFinderTool(); @@ -378,11 +391,11 @@ static int HandleFindReferences(FileInfo databasePath, string outputFile, long? if (objectId != null) { - return finder.FindReferences(objectId.Value, databasePath.FullName, outputFile, findAll); + return finder.FindReferences(objectId.Value, databasePath.FullName, outputFile, findAll, toStdout); } else { - return finder.FindReferences(objectName, objectType, databasePath.FullName, outputFile, findAll); + return finder.FindReferences(objectName, objectType, databasePath.FullName, outputFile, findAll, toStdout); } } diff --git a/UnityFileSystem/TypeIdRegistry.cs b/UnityFileSystem/TypeIdRegistry.cs index 211392b..f09a862 100644 --- a/UnityFileSystem/TypeIdRegistry.cs +++ b/UnityFileSystem/TypeIdRegistry.cs @@ -6,7 +6,7 @@ namespace UnityDataTools.FileSystem; /// Registry of Unity TypeIds mapped to their type names. /// Used as a fallback when TypeTree information is not available. /// The entries below are generated from the live engine type list by the -/// TypeIdRegistryGenerator tool (UnityFileSystemTestData/Assets/Editor/TypeIdRegistryGenerator.cs); +/// TypeIdRegistryGenerator tool (UnityProjects/Baseline/Assets/Editor/TypeIdRegistryGenerator.cs); /// regenerate with a current Unity Editor rather than editing them by hand. /// Reference: https://docs.unity3d.com/Manual/ClassIDReference.html /// diff --git a/UnityProjects/Baseline/AGENTS.md b/UnityProjects/Baseline/AGENTS.md new file mode 100644 index 0000000..5a7e691 --- /dev/null +++ b/UnityProjects/Baseline/AGENTS.md @@ -0,0 +1,16 @@ +# Baseline test project + +A Unity project that generates test data for the UnityDataTools test suites. It intentionally tracks older broadly-used Unity features and is upgraded only when necessary, it should be updated with the oldest currently supported LTS version. + +## Assets + +A deliberately broad mix of asset types, so the tool is exercised against many serialized object types: a shader, animation clips (including a legacy animation), an animator controller, a material, a prefab, FBX models, TIFF/JPG textures, a WAV clip and several scenes. `SerializeReferencePolymorphismExample.cs` demonstrates polymorphic `[SerializeReference]` fields. + +## Editor scripts (`Assets/Editor`, `Tools` menu) + +* `BuildAssetBundles.cs` + * **Generate AssetBundles** - builds the `assetbundle` and `scenes` bundles (StandaloneOSX) and copies them to `TestCommon/Data/AssetBundles/`. + * **Generate PlayerData** - builds a player and copies its `level0` to `TestCommon/Data/PlayerData/`. Requires the `ForceAlwaysWriteTypeTrees` diagnostic switch (Editor Preferences > Diagnostic/Editor). +* `TypeIdRegistryGenerator.cs` - regenerates `UnityFileSystem/TypeIdRegistry.cs` from the live engine type list. Run via **Tools > Generate TypeIdRegistry** or headless with `-executeMethod TypeIdRegistryGenerator.Generate`. + +Output is written under a per-Unity-version subfolder so data from multiple versions can coexist. diff --git a/UnityFileSystemTestData/Assets/AssetBundle2Data.meta b/UnityProjects/Baseline/Assets/AssetBundle2Data.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundle2Data.meta rename to UnityProjects/Baseline/Assets/AssetBundle2Data.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundle2Data/Shader.shader b/UnityProjects/Baseline/Assets/AssetBundle2Data/Shader.shader similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundle2Data/Shader.shader rename to UnityProjects/Baseline/Assets/AssetBundle2Data/Shader.shader diff --git a/UnityFileSystemTestData/Assets/AssetBundle2Data/Shader.shader.meta b/UnityProjects/Baseline/Assets/AssetBundle2Data/Shader.shader.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundle2Data/Shader.shader.meta rename to UnityProjects/Baseline/Assets/AssetBundle2Data/Shader.shader.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData.meta b/UnityProjects/Baseline/Assets/AssetBundleData.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData.meta rename to UnityProjects/Baseline/Assets/AssetBundleData.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Animation.anim b/UnityProjects/Baseline/Assets/AssetBundleData/Animation.anim similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Animation.anim rename to UnityProjects/Baseline/Assets/AssetBundleData/Animation.anim diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Animation.anim.meta b/UnityProjects/Baseline/Assets/AssetBundleData/Animation.anim.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Animation.anim.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/Animation.anim.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/AnimatorControlle.controller b/UnityProjects/Baseline/Assets/AssetBundleData/AnimatorControlle.controller similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/AnimatorControlle.controller rename to UnityProjects/Baseline/Assets/AssetBundleData/AnimatorControlle.controller diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/AnimatorControlle.controller.meta b/UnityProjects/Baseline/Assets/AssetBundleData/AnimatorControlle.controller.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/AnimatorControlle.controller.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/AnimatorControlle.controller.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/LegacyAnimation.anim b/UnityProjects/Baseline/Assets/AssetBundleData/LegacyAnimation.anim similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/LegacyAnimation.anim rename to UnityProjects/Baseline/Assets/AssetBundleData/LegacyAnimation.anim diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/LegacyAnimation.anim.meta b/UnityProjects/Baseline/Assets/AssetBundleData/LegacyAnimation.anim.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/LegacyAnimation.anim.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/LegacyAnimation.anim.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Material.mat b/UnityProjects/Baseline/Assets/AssetBundleData/Material.mat similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Material.mat rename to UnityProjects/Baseline/Assets/AssetBundleData/Material.mat diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Material.mat.meta b/UnityProjects/Baseline/Assets/AssetBundleData/Material.mat.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Material.mat.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/Material.mat.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Prefab.prefab b/UnityProjects/Baseline/Assets/AssetBundleData/Prefab.prefab similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Prefab.prefab rename to UnityProjects/Baseline/Assets/AssetBundleData/Prefab.prefab diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Prefab.prefab.meta b/UnityProjects/Baseline/Assets/AssetBundleData/Prefab.prefab.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Prefab.prefab.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/Prefab.prefab.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Robot_Basic.fbx b/UnityProjects/Baseline/Assets/AssetBundleData/Robot_Basic.fbx similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Robot_Basic.fbx rename to UnityProjects/Baseline/Assets/AssetBundleData/Robot_Basic.fbx diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Robot_Basic.fbx.meta b/UnityProjects/Baseline/Assets/AssetBundleData/Robot_Basic.fbx.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Robot_Basic.fbx.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/Robot_Basic.fbx.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Square_Soft_A_Cookie.tif b/UnityProjects/Baseline/Assets/AssetBundleData/Square_Soft_A_Cookie.tif similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Square_Soft_A_Cookie.tif rename to UnityProjects/Baseline/Assets/AssetBundleData/Square_Soft_A_Cookie.tif diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Square_Soft_A_Cookie.tif.meta b/UnityProjects/Baseline/Assets/AssetBundleData/Square_Soft_A_Cookie.tif.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Square_Soft_A_Cookie.tif.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/Square_Soft_A_Cookie.tif.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Sting-Sword lowpoly.fbx b/UnityProjects/Baseline/Assets/AssetBundleData/Sting-Sword lowpoly.fbx similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Sting-Sword lowpoly.fbx rename to UnityProjects/Baseline/Assets/AssetBundleData/Sting-Sword lowpoly.fbx diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/Sting-Sword lowpoly.fbx.meta b/UnityProjects/Baseline/Assets/AssetBundleData/Sting-Sword lowpoly.fbx.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/Sting-Sword lowpoly.fbx.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/Sting-Sword lowpoly.fbx.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/blip.wav b/UnityProjects/Baseline/Assets/AssetBundleData/blip.wav similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/blip.wav rename to UnityProjects/Baseline/Assets/AssetBundleData/blip.wav diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/blip.wav.meta b/UnityProjects/Baseline/Assets/AssetBundleData/blip.wav.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/blip.wav.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/blip.wav.meta diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/wood.jpg b/UnityProjects/Baseline/Assets/AssetBundleData/wood.jpg similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/wood.jpg rename to UnityProjects/Baseline/Assets/AssetBundleData/wood.jpg diff --git a/UnityFileSystemTestData/Assets/AssetBundleData/wood.jpg.meta b/UnityProjects/Baseline/Assets/AssetBundleData/wood.jpg.meta similarity index 100% rename from UnityFileSystemTestData/Assets/AssetBundleData/wood.jpg.meta rename to UnityProjects/Baseline/Assets/AssetBundleData/wood.jpg.meta diff --git a/UnityFileSystemTestData/Assets/Editor.meta b/UnityProjects/Baseline/Assets/Editor.meta similarity index 100% rename from UnityFileSystemTestData/Assets/Editor.meta rename to UnityProjects/Baseline/Assets/Editor.meta diff --git a/UnityFileSystemTestData/Assets/Editor/BuildAssetBundles.cs b/UnityProjects/Baseline/Assets/Editor/BuildAssetBundles.cs similarity index 100% rename from UnityFileSystemTestData/Assets/Editor/BuildAssetBundles.cs rename to UnityProjects/Baseline/Assets/Editor/BuildAssetBundles.cs diff --git a/UnityFileSystemTestData/Assets/Editor/BuildAssetBundles.cs.meta b/UnityProjects/Baseline/Assets/Editor/BuildAssetBundles.cs.meta similarity index 100% rename from UnityFileSystemTestData/Assets/Editor/BuildAssetBundles.cs.meta rename to UnityProjects/Baseline/Assets/Editor/BuildAssetBundles.cs.meta diff --git a/UnityFileSystemTestData/Assets/Editor/TypeIdRegistryGenerator.cs b/UnityProjects/Baseline/Assets/Editor/TypeIdRegistryGenerator.cs similarity index 100% rename from UnityFileSystemTestData/Assets/Editor/TypeIdRegistryGenerator.cs rename to UnityProjects/Baseline/Assets/Editor/TypeIdRegistryGenerator.cs diff --git a/UnityFileSystemTestData/Assets/Editor/TypeIdRegistryGenerator.cs.meta b/UnityProjects/Baseline/Assets/Editor/TypeIdRegistryGenerator.cs.meta similarity index 100% rename from UnityFileSystemTestData/Assets/Editor/TypeIdRegistryGenerator.cs.meta rename to UnityProjects/Baseline/Assets/Editor/TypeIdRegistryGenerator.cs.meta diff --git a/UnityFileSystemTestData/Assets/Scenes.meta b/UnityProjects/Baseline/Assets/Scenes.meta similarity index 100% rename from UnityFileSystemTestData/Assets/Scenes.meta rename to UnityProjects/Baseline/Assets/Scenes.meta diff --git a/UnityFileSystemTestData/Assets/Scenes/OtherScene.unity b/UnityProjects/Baseline/Assets/Scenes/OtherScene.unity similarity index 100% rename from UnityFileSystemTestData/Assets/Scenes/OtherScene.unity rename to UnityProjects/Baseline/Assets/Scenes/OtherScene.unity diff --git a/UnityFileSystemTestData/Assets/Scenes/OtherScene.unity.meta b/UnityProjects/Baseline/Assets/Scenes/OtherScene.unity.meta similarity index 100% rename from UnityFileSystemTestData/Assets/Scenes/OtherScene.unity.meta rename to UnityProjects/Baseline/Assets/Scenes/OtherScene.unity.meta diff --git a/UnityFileSystemTestData/Assets/Scenes/SampleScene.unity b/UnityProjects/Baseline/Assets/Scenes/SampleScene.unity similarity index 100% rename from UnityFileSystemTestData/Assets/Scenes/SampleScene.unity rename to UnityProjects/Baseline/Assets/Scenes/SampleScene.unity diff --git a/UnityFileSystemTestData/Assets/Scenes/SampleScene.unity.meta b/UnityProjects/Baseline/Assets/Scenes/SampleScene.unity.meta similarity index 100% rename from UnityFileSystemTestData/Assets/Scenes/SampleScene.unity.meta rename to UnityProjects/Baseline/Assets/Scenes/SampleScene.unity.meta diff --git a/UnityFileSystemTestData/Assets/Scenes/SampleSceneSettings.lighting b/UnityProjects/Baseline/Assets/Scenes/SampleSceneSettings.lighting similarity index 100% rename from UnityFileSystemTestData/Assets/Scenes/SampleSceneSettings.lighting rename to UnityProjects/Baseline/Assets/Scenes/SampleSceneSettings.lighting diff --git a/UnityFileSystemTestData/Assets/Scenes/SampleSceneSettings.lighting.meta b/UnityProjects/Baseline/Assets/Scenes/SampleSceneSettings.lighting.meta similarity index 100% rename from UnityFileSystemTestData/Assets/Scenes/SampleSceneSettings.lighting.meta rename to UnityProjects/Baseline/Assets/Scenes/SampleSceneSettings.lighting.meta diff --git a/UnityFileSystemTestData/Assets/SerializeReferencePolymorphismExample.cs b/UnityProjects/Baseline/Assets/SerializeReferencePolymorphismExample.cs similarity index 100% rename from UnityFileSystemTestData/Assets/SerializeReferencePolymorphismExample.cs rename to UnityProjects/Baseline/Assets/SerializeReferencePolymorphismExample.cs diff --git a/UnityFileSystemTestData/Assets/SerializeReferencePolymorphismExample.cs.meta b/UnityProjects/Baseline/Assets/SerializeReferencePolymorphismExample.cs.meta similarity index 100% rename from UnityFileSystemTestData/Assets/SerializeReferencePolymorphismExample.cs.meta rename to UnityProjects/Baseline/Assets/SerializeReferencePolymorphismExample.cs.meta diff --git a/UnityProjects/Baseline/CLAUDE.md b/UnityProjects/Baseline/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/UnityProjects/Baseline/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/UnityProjects/LeadingEdge/AGENTS.md b/UnityProjects/LeadingEdge/AGENTS.md new file mode 100644 index 0000000..4dca213 --- /dev/null +++ b/UnityProjects/LeadingEdge/AGENTS.md @@ -0,0 +1,28 @@ +# LeadingEdge test project + +A Unity project that tracks the newest Unity version (currently 6000.6.0b3) and is updated proactively so UnityDataTools can be tested against the latest build features - for example Content Directory builds and serialized `Dictionary<,>` fields. + +Its build scripts produce the reference output checked in at `TestCommon/Data/LeadingEdgeBuilds` (see that folder's `AGENTS.md`). To update it, rebuild with the scripts below and check in the results. + +## Assets + +Both builds start from a root ScriptableObject whose serialized dictionary maps names to other ScriptableObjects in the project. The referenced assets cover two scenarios: + +1. **AudioClip references.** ScriptableObjects reference the project's two mp3 files. `a.mp3` is referenced from two different ScriptableObjects and `6.mp3` from one, demonstrating that all referenced content is included in the build exactly once, with no duplication. +2. **`SerializationDemo` asset.** A ScriptableObject with fields of many types, including a `[SerializeReference]` field. Useful for testing the `dump` command and for inspecting serialized field values directly. + +## Editor scripts (`Assets/Editor`, `ContentDirectory` menu) + +* `GenerateAssets.cs` - creates the ScriptableObject assets in `Assets/ScriptableObjects`, populating the serialized dictionaries before saving so the entries are serialized into the assets. +* `BuildAssetBundles.cs` - runs the AssetBundle build and copies its build report. +* `BuildContentDirectory.cs` - runs the Content Directory build and copies its build report folder. + +Both build scripts write directly into `TestCommon/Data/LeadingEdgeBuilds` using paths relative to the project root. + +## Content Directory Build + +The root asset is `ContentDirectoryRoot.asset`. It directly references the `LoadableAudioClipReference` assets, so those are loaded automatically when the content directory is registered. The AudioClips themselves are referenced through `Loadable`, so they are included in the build but loaded only on demand. + +## AssetBundle Build + +The root asset is `AssetBundleRoot.asset`. AssetBundles do not support `Loadable`, so this build uses the direct-reference variants of the assets instead. Each asset is placed in its own bundle (named after the asset) - a highly granular layout that guarantees no content is duplicated across bundles. diff --git a/UnityProjects/LeadingEdge/Assets/Audio.meta b/UnityProjects/LeadingEdge/Assets/Audio.meta new file mode 100644 index 0000000..190a545 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Audio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1cf86fc18d360f469df4c88f1d52aa2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/Audio/6.mp3 b/UnityProjects/LeadingEdge/Assets/Audio/6.mp3 new file mode 100644 index 0000000..9cd46ce Binary files /dev/null and b/UnityProjects/LeadingEdge/Assets/Audio/6.mp3 differ diff --git a/UnityProjects/LeadingEdge/Assets/Audio/6.mp3.meta b/UnityProjects/LeadingEdge/Assets/Audio/6.mp3.meta new file mode 100644 index 0000000..e3138db --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Audio/6.mp3.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 278c261333bf8604eb5c83790d02004d diff --git a/UnityProjects/LeadingEdge/Assets/Audio/a.mp3 b/UnityProjects/LeadingEdge/Assets/Audio/a.mp3 new file mode 100644 index 0000000..fd57864 Binary files /dev/null and b/UnityProjects/LeadingEdge/Assets/Audio/a.mp3 differ diff --git a/UnityProjects/LeadingEdge/Assets/Audio/a.mp3.meta b/UnityProjects/LeadingEdge/Assets/Audio/a.mp3.meta new file mode 100644 index 0000000..ef181d2 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Audio/a.mp3.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b65a7916245593b4e89f4bd0aa920533 diff --git a/UnityProjects/LeadingEdge/Assets/Editor.meta b/UnityProjects/LeadingEdge/Assets/Editor.meta new file mode 100644 index 0000000..a4e60e5 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7cb3862195daf7749a91f2f549934213 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/Editor/BuildAssetBundles.cs b/UnityProjects/LeadingEdge/Assets/Editor/BuildAssetBundles.cs new file mode 100644 index 0000000..b2b3f04 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Editor/BuildAssetBundles.cs @@ -0,0 +1,73 @@ +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +// Builds AssetBundles directly into the checked-in reference data under TestCommon. Every asset gets its own bundle +// (named after its filename): the AssetBundleRoot, both DirectAudioClipReference assets, and each mp3 in +// Assets/Audio. This highly granular layout ensures no asset is duplicated across bundles - shared assets +// (e.g. a.mp3) live in a single bundle that the others depend on. The build report is copied alongside the output. +public static class BuildAssetBundles +{ + const string AudioFolder = "Assets/Audio"; + + // Relative to the project root, which is the working directory when the build runs. + const string TestDataFolder = "../../TestCommon/Data/LeadingEdgeBuilds"; + const string OutputFolder = TestDataFolder + "/AssetBundles"; + const string BuildReportFolder = TestDataFolder + "/BuildReport-AssetBundles"; + + static readonly string[] DirectAssets = + { + "Assets/ScriptableObjects/AssetBundleRoot.asset", + "Assets/ScriptableObjects/DirectAudioClipReference.asset", + "Assets/ScriptableObjects/SingleAudioClipDirectReference.asset", + "Assets/ScriptableObjects/SerializationDemo.asset" + }; + + [MenuItem("ContentDirectory/Build AssetBundles")] + public static void Build() + { + Directory.CreateDirectory(OutputFolder); + + var bundles = new List(); + + foreach (var assetPath in DirectAssets) + { + bundles.Add(new AssetBundleBuild + { + assetBundleName = Path.GetFileNameWithoutExtension(assetPath), + assetNames = new[] { assetPath } + }); + } + + foreach (var guid in AssetDatabase.FindAssets("t:AudioClip", new[] { AudioFolder })) + { + var path = AssetDatabase.GUIDToAssetPath(guid); + bundles.Add(new AssetBundleBuild + { + assetBundleName = Path.GetFileNameWithoutExtension(path), + assetNames = new[] { path } + }); + } + + var parameters = new BuildAssetBundlesParameters + { + outputPath = OutputFolder, + bundleDefinitions = bundles.ToArray(), + options = BuildAssetBundleOptions.None, + targetPlatform = EditorUserBuildSettings.activeBuildTarget + }; + + var manifest = BuildPipeline.BuildAssetBundles(parameters); + if (manifest == null) + { + Debug.LogError("BuildAssetBundles: build failed."); + return; + } + + Directory.CreateDirectory(BuildReportFolder); + File.Copy("Library/LastBuild.buildreport", $"{BuildReportFolder}/LastBuild.buildreport", true); + + Debug.Log($"BuildAssetBundles: built {manifest.GetAllAssetBundles().Length} bundles into {OutputFolder}."); + } +} diff --git a/UnityProjects/LeadingEdge/Assets/Editor/BuildAssetBundles.cs.meta b/UnityProjects/LeadingEdge/Assets/Editor/BuildAssetBundles.cs.meta new file mode 100644 index 0000000..634389c --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Editor/BuildAssetBundles.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8a17ff4e0f494744088d941d5b087b5f \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/Assets/Editor/BuildContentDirectory.cs b/UnityProjects/LeadingEdge/Assets/Editor/BuildContentDirectory.cs new file mode 100644 index 0000000..a57f4b7 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Editor/BuildContentDirectory.cs @@ -0,0 +1,67 @@ +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEditor.Build.Reporting; +using UnityEngine; + +// Builds a Content Directory directly into the checked-in reference data under TestCommon, using +// ContentDirectoryRoot.asset as the root. ContentDirectoryRoot directly references the two +// LoadableAudioClipReference assets, so those are loaded automatically when the content directory is registered. +// The AudioClips themselves are referenced through Loadable, so they are included in the build but only +// loaded on demand, not at registration. The build report folder is copied alongside the output. +public static class BuildContentDirectory +{ + const string RootAsset = "Assets/ScriptableObjects/ContentDirectoryRoot.asset"; + + // Relative to the project root, which is the working directory when the build runs. + const string TestDataFolder = "../../TestCommon/Data/LeadingEdgeBuilds"; + const string OutputFolder = TestDataFolder + "/ContentDirectory"; + const string BuildReportFolder = TestDataFolder + "/BuildReport-ContentDirectory"; + + [MenuItem("ContentDirectory/Build Content Directory")] + public static void Build() + { + var parameters = new BuildContentDirectoryParameters + { + outputPath = OutputFolder, + rootAssetPaths = new[] { RootAsset }, + options = BuildContentOptions.CleanBuildCache, + compression = BuildCompression.Uncompressed + }; + + var report = BuildPipeline.BuildContentDirectory(parameters); + if (report.summary.result != BuildResult.Succeeded) + { + Debug.LogError($"BuildContentDirectory: failed with result {report.summary.result}."); + return; + } + + CopyLatestBuildReport(); + + Debug.Log($"BuildContentDirectory: succeeded, output in {OutputFolder}."); + } + + // The content directory build writes its report (including ContentLayout.json) to a timestamped folder under + // Library/BuildHistory. Mirror the most recent one into the checked-in reference data. + static void CopyLatestBuildReport() + { + var latest = new DirectoryInfo("Library/BuildHistory") + .GetDirectories() + .OrderByDescending(d => d.CreationTimeUtc) + .First(); + + if (Directory.Exists(BuildReportFolder)) + Directory.Delete(BuildReportFolder, true); + + CopyDirectory(latest.FullName, BuildReportFolder); + } + + static void CopyDirectory(string source, string dest) + { + Directory.CreateDirectory(dest); + foreach (var file in Directory.GetFiles(source)) + File.Copy(file, Path.Combine(dest, Path.GetFileName(file)), true); + foreach (var dir in Directory.GetDirectories(source)) + CopyDirectory(dir, Path.Combine(dest, Path.GetFileName(dir))); + } +} diff --git a/UnityProjects/LeadingEdge/Assets/Editor/BuildContentDirectory.cs.meta b/UnityProjects/LeadingEdge/Assets/Editor/BuildContentDirectory.cs.meta new file mode 100644 index 0000000..3a91b98 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Editor/BuildContentDirectory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 58ae5bbedc3c3294aaf7fccc63ede17a \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs b/UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs new file mode 100644 index 0000000..9b7edf0 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs @@ -0,0 +1,78 @@ +using System.Collections.Generic; +using System.IO; +using Unity.Loading; +using UnityEditor; +using UnityEngine; + +// Generates the ScriptableObject assets used as build sources. The dictionaries are populated before the assets +// are saved, so the entries are serialized into the asset files. +// +// Leaf assets reference AudioClips (directly or via Loadable). The single-clip variants reference only a.mp3, +// which is also referenced by the all-clips variants, demonstrating an AudioClip shared between two assets. +// The root assets (DirectScriptableObjectReference) directly reference the leaf assets and act as build roots. +public static class GenerateAssets +{ + const string AudioFolder = "Assets/Audio"; + const string OutputFolder = "Assets/ScriptableObjects"; + + [MenuItem("ContentDirectory/Generate Assets")] + public static void Generate() + { + if (!AssetDatabase.IsValidFolder(OutputFolder)) + AssetDatabase.CreateFolder("Assets", "ScriptableObjects"); + + // All AudioClips keyed by filename without extension, e.g. "6.mp3" -> "6". + var allClips = new Dictionary(); + foreach (var guid in AssetDatabase.FindAssets("t:AudioClip", new[] { AudioFolder })) + { + var path = AssetDatabase.GUIDToAssetPath(guid); + allClips[Path.GetFileNameWithoutExtension(path)] = AssetDatabase.LoadAssetAtPath(path); + } + + // The single-clip assets reference only a.mp3, which is also part of the all-clips assets. + var singleClip = new Dictionary { { "a", allClips["a"] } }; + + var direct = CreateDirect("DirectAudioClipReference", allClips); + var loadable = CreateLoadable("LoadableAudioClipReference", allClips); + var singleDirect = CreateDirect("SingleAudioClipDirectReference", singleClip); + var singleLoadable = CreateLoadable("SingleAudioClipLoadableReference", singleClip); + + // Serialization demo asset, referenced from both build roots so it ends up in both build outputs. + var serializationDemo = ScriptableObject.CreateInstance(); + serializationDemo.data = new SerializationDemo.SerializedData(); + AssetDatabase.CreateAsset(serializationDemo, $"{OutputFolder}/SerializationDemo.asset"); + + CreateReference("AssetBundleRoot", direct, singleDirect, serializationDemo); + CreateReference("ContentDirectoryRoot", loadable, singleLoadable, serializationDemo); + + AssetDatabase.SaveAssets(); + + Debug.Log("GenerateAssets: created leaf reference assets and AssetBundleRoot / ContentDirectoryRoot."); + } + + static DirectAudioClipReference CreateDirect(string name, Dictionary clips) + { + var asset = ScriptableObject.CreateInstance(); + foreach (var kvp in clips) + asset.clips[kvp.Key] = kvp.Value; + AssetDatabase.CreateAsset(asset, $"{OutputFolder}/{name}.asset"); + return asset; + } + + static LoadableAudioClipReference CreateLoadable(string name, Dictionary clips) + { + var asset = ScriptableObject.CreateInstance(); + foreach (var kvp in clips) + asset.clips[kvp.Key] = new Loadable(LoadableObjectIdEditorUtility.CreateLoadableObjectId(kvp.Value)); + AssetDatabase.CreateAsset(asset, $"{OutputFolder}/{name}.asset"); + return asset; + } + + static void CreateReference(string name, params ScriptableObject[] targets) + { + var asset = ScriptableObject.CreateInstance(); + foreach (var target in targets) + asset.references[target.name] = target; + AssetDatabase.CreateAsset(asset, $"{OutputFolder}/{name}.asset"); + } +} diff --git a/UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs.meta b/UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs.meta new file mode 100644 index 0000000..efc1ecf --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Editor/GenerateAssets.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: abda831dbbbf4c64c846c6a403f2f9f8 \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/Assets/InputSystem_Actions.inputactions b/UnityProjects/LeadingEdge/Assets/InputSystem_Actions.inputactions new file mode 100644 index 0000000..1a12cb9 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/InputSystem_Actions.inputactions @@ -0,0 +1,1057 @@ +{ + "name": "InputSystem_Actions", + "maps": [ + { + "name": "Player", + "id": "df70fa95-8a34-4494-b137-73ab6b9c7d37", + "actions": [ + { + "name": "Move", + "type": "Value", + "id": "351f2ccd-1f9f-44bf-9bec-d62ac5c5f408", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Look", + "type": "Value", + "id": "6b444451-8a00-4d00-a97e-f47457f736a8", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Attack", + "type": "Button", + "id": "6c2ab1b8-8984-453a-af3d-a3c78ae1679a", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Interact", + "type": "Button", + "id": "852140f2-7766-474d-8707-702459ba45f3", + "expectedControlType": "Button", + "processors": "", + "interactions": "Hold", + "initialStateCheck": false + }, + { + "name": "Crouch", + "type": "Button", + "id": "27c5f898-bc57-4ee1-8800-db469aca5fe3", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Jump", + "type": "Button", + "id": "f1ba0d36-48eb-4cd5-b651-1c94a6531f70", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Previous", + "type": "Button", + "id": "2776c80d-3c14-4091-8c56-d04ced07a2b0", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Next", + "type": "Button", + "id": "b7230bb6-fc9b-4f52-8b25-f5e19cb2c2ba", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Sprint", + "type": "Button", + "id": "641cd816-40e6-41b4-8c3d-04687c349290", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "", + "id": "978bfe49-cc26-4a3d-ab7b-7d7a29327403", + "path": "/leftStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "WASD", + "id": "00ca640b-d935-4593-8157-c05846ea39b3", + "path": "Dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "e2062cb9-1b15-46a2-838c-2f8d72a0bdd9", + "path": "/w", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "8180e8bd-4097-4f4e-ab88-4523101a6ce9", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "320bffee-a40b-4347-ac70-c210eb8bc73a", + "path": "/s", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "1c5327b5-f71c-4f60-99c7-4e737386f1d1", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "d2581a9b-1d11-4566-b27d-b92aff5fabbc", + "path": "/a", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "2e46982e-44cc-431b-9f0b-c11910bf467a", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcfe95b8-67b9-4526-84b5-5d0bc98d6400", + "path": "/d", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "77bff152-3580-4b21-b6de-dcd0c7e41164", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "1635d3fe-58b6-4ba9-a4e2-f4b964f6b5c8", + "path": "/{Primary2DAxis}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3ea4d645-4504-4529-b061-ab81934c3752", + "path": "/stick", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c1f7a91b-d0fd-4a62-997e-7fb9b69bf235", + "path": "/rightStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8c8e490b-c610-4785-884f-f04217b23ca4", + "path": "/delta", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse;Touch", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3e5f5442-8668-4b27-a940-df99bad7e831", + "path": "/{Hatswitch}", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "143bb1cd-cc10-4eca-a2f0-a3664166fe91", + "path": "/buttonWest", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "05f6913d-c316-48b2-a6bb-e225f14c7960", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "886e731e-7071-4ae4-95c0-e61739dad6fd", + "path": "/primaryTouch/tap", + "interactions": "", + "processors": "", + "groups": ";Touch", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ee3d0cd2-254e-47a7-a8cb-bc94d9658c54", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8255d333-5683-4943-a58a-ccb207ff1dce", + "path": "/{PrimaryAction}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b3c1c7f0-bd20-4ee7-a0f1-899b24bca6d7", + "path": "/enter", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "cbac6039-9c09-46a1-b5f2-4e5124ccb5ed", + "path": "/2", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e15ca19d-e649-4852-97d5-7fe8ccc44e94", + "path": "/dpad/right", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "f2e9ba44-c423-42a7-ad56-f20975884794", + "path": "/leftShift", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8cbb2f4b-a784-49cc-8d5e-c010b8c7f4e6", + "path": "/leftStickPress", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "d8bf24bf-3f2f-4160-a97c-38ec1eb520ba", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "eb40bb66-4559-4dfa-9a2f-820438abb426", + "path": "/space", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "daba33a1-ad0c-4742-a909-43ad1cdfbeb6", + "path": "/buttonSouth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "603f3daf-40bd-4854-8724-93e8017f59e3", + "path": "/secondaryButton", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1534dc16-a6aa-499d-9c3a-22b47347b52a", + "path": "/1", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "25060bbd-a3a6-476e-8fba-45ae484aad05", + "path": "/dpad/left", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1c04ea5f-b012-41d1-a6f7-02e963b52893", + "path": "/e", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b3f66d0b-7751-423f-908b-a11c5bd95930", + "path": "/buttonNorth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4f4649ac-64a8-4a73-af11-b3faef356a4d", + "path": "/buttonEast", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "36e52cba-0905-478e-a818-f4bfcb9f3b9a", + "path": "/c", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "UI", + "id": "272f6d14-89ba-496f-b7ff-215263d3219f", + "actions": [ + { + "name": "Navigate", + "type": "PassThrough", + "id": "c95b2375-e6d9-4b88-9c4c-c5e76515df4b", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Submit", + "type": "Button", + "id": "7607c7b6-cd76-4816-beef-bd0341cfe950", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Cancel", + "type": "Button", + "id": "15cef263-9014-4fd5-94d9-4e4a6234a6ef", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Point", + "type": "PassThrough", + "id": "32b35790-4ed0-4e9a-aa41-69ac6d629449", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Click", + "type": "PassThrough", + "id": "3c7022bf-7922-4f7c-a998-c437916075ad", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "RightClick", + "type": "PassThrough", + "id": "44b200b1-1557-4083-816c-b22cbdf77ddf", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "MiddleClick", + "type": "PassThrough", + "id": "dad70c86-b58c-4b17-88ad-f5e53adf419e", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "ScrollWheel", + "type": "PassThrough", + "id": "0489e84a-4833-4c40-bfae-cea84b696689", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDevicePosition", + "type": "PassThrough", + "id": "24908448-c609-4bc3-a128-ea258674378a", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDeviceOrientation", + "type": "PassThrough", + "id": "9caa3d8a-6b2f-4e8e-8bad-6ede561bd9be", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "Gamepad", + "id": "809f371f-c5e2-4e7a-83a1-d867598f40dd", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "14a5d6e8-4aaf-4119-a9ef-34b8c2c548bf", + "path": "/leftStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "9144cbe6-05e1-4687-a6d7-24f99d23dd81", + "path": "/rightStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2db08d65-c5fb-421b-983f-c71163608d67", + "path": "/leftStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "58748904-2ea9-4a80-8579-b500e6a76df8", + "path": "/rightStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "8ba04515-75aa-45de-966d-393d9bbd1c14", + "path": "/leftStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "712e721c-bdfb-4b23-a86c-a0d9fcfea921", + "path": "/rightStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcd248ae-a788-4676-a12e-f4d81205600b", + "path": "/leftStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "1f04d9bc-c50b-41a1-bfcc-afb75475ec20", + "path": "/rightStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "fb8277d4-c5cd-4663-9dc7-ee3f0b506d90", + "path": "/dpad", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Joystick", + "id": "e25d9774-381c-4a61-b47c-7b6b299ad9f9", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "3db53b26-6601-41be-9887-63ac74e79d19", + "path": "/stick/up", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "0cb3e13e-3d90-4178-8ae6-d9c5501d653f", + "path": "/stick/down", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "0392d399-f6dd-4c82-8062-c1e9c0d34835", + "path": "/stick/left", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "942a66d9-d42f-43d6-8d70-ecb4ba5363bc", + "path": "/stick/right", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "Keyboard", + "id": "ff527021-f211-4c02-933e-5976594c46ed", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "563fbfdd-0f09-408d-aa75-8642c4f08ef0", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "eb480147-c587-4a33-85ed-eb0ab9942c43", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2bf42165-60bc-42ca-8072-8c13ab40239b", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "85d264ad-e0a0-4565-b7ff-1a37edde51ac", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "74214943-c580-44e4-98eb-ad7eebe17902", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "cea9b045-a000-445b-95b8-0c171af70a3b", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "8607c725-d935-4808-84b1-8354e29bab63", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "4cda81dc-9edd-4e03-9d7c-a71a14345d0b", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "9e92bb26-7e3b-4ec4-b06b-3c8f8e498ddc", + "path": "*/{Submit}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Submit", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "82627dcc-3b13-4ba9-841d-e4b746d6553e", + "path": "*/{Cancel}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Cancel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c52c8e0b-8179-41d3-b8a1-d149033bbe86", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e1394cbc-336e-44ce-9ea8-6007ed6193f7", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "5693e57a-238a-46ed-b5ae-e64e6e574302", + "path": "/touch*/position", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4faf7dc9-b979-4210-aa8c-e808e1ef89f5", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8d66d5ba-88d7-48e6-b1cd-198bbfef7ace", + "path": "/tip", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "47c2a644-3ebc-4dae-a106-589b7ca75b59", + "path": "/touch*/press", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "bb9e6b34-44bf-4381-ac63-5aa15d19f677", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "38c99815-14ea-4617-8627-164d27641299", + "path": "/scroll", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "ScrollWheel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4c191405-5738-4d4b-a523-c6a301dbf754", + "path": "/rightButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "RightClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "24066f69-da47-44f3-a07e-0015fb02eb2e", + "path": "/middleButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "MiddleClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77", + "path": "/devicePosition", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDevicePosition", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "23e01e3a-f935-4948-8d8b-9bcac77714fb", + "path": "/deviceRotation", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDeviceOrientation", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [ + { + "name": "Keyboard&Mouse", + "bindingGroup": "Keyboard&Mouse", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + }, + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Gamepad", + "bindingGroup": "Gamepad", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Touch", + "bindingGroup": "Touch", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Joystick", + "bindingGroup": "Joystick", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "XR", + "bindingGroup": "XR", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + } + ] +} \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/Assets/InputSystem_Actions.inputactions.meta b/UnityProjects/LeadingEdge/Assets/InputSystem_Actions.inputactions.meta new file mode 100644 index 0000000..e25b7aa --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/InputSystem_Actions.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 3590b91b4603b465dbb4216d601bff33 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 0 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/UnityProjects/LeadingEdge/Assets/Scenes.meta b/UnityProjects/LeadingEdge/Assets/Scenes.meta new file mode 100644 index 0000000..0d01452 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae1c144d04fa32e45a48bf7a7b13bd2d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/Scenes/SampleScene.unity b/UnityProjects/LeadingEdge/Assets/Scenes/SampleScene.unity new file mode 100644 index 0000000..9421266 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scenes/SampleScene.unity @@ -0,0 +1,208 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &519420028 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 519420032} + - component: {fileID: 519420031} + - component: {fileID: 519420029} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &519420029 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_Enabled: 1 +--- !u!20 &519420031 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 0 + m_HDR: 1 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 0 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &519420032 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/UnityProjects/LeadingEdge/Assets/Scenes/SampleScene.unity.meta b/UnityProjects/LeadingEdge/Assets/Scenes/SampleScene.unity.meta new file mode 100644 index 0000000..c1e3c88 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scenes/SampleScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2cda990e2423bbf4892e6590ba056729 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects.meta new file mode 100644 index 0000000..1fc39b6 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c0a5d512ac5fd9048a54a51f4f8b9f4c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/AssetBundleRoot.asset b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/AssetBundleRoot.asset new file mode 100644 index 0000000..d71e5d0 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/AssetBundleRoot.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8623c5efbb626994da80931050f0aba0, type: 3} + m_Name: AssetBundleRoot + m_EditorClassIdentifier: Assembly-CSharp::DirectScriptableObjectReference + references: + - key: DirectAudioClipReference + value: {fileID: 11400000, guid: c58476a984dba8d4897a10b387e7bc3b, type: 2} + - key: SingleAudioClipDirectReference + value: {fileID: 11400000, guid: 0bfc83564a9c3024bb15ff70c58eef45, type: 2} + - key: SerializationDemo + value: {fileID: 11400000, guid: 78532141fd7679a458405eb16bdb75fd, type: 2} diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/AssetBundleRoot.asset.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/AssetBundleRoot.asset.meta new file mode 100644 index 0000000..f7582b3 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/AssetBundleRoot.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f1eef25b4ab04141ae13066539a29cd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/ContentDirectoryRoot.asset b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/ContentDirectoryRoot.asset new file mode 100644 index 0000000..b22f315 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/ContentDirectoryRoot.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8623c5efbb626994da80931050f0aba0, type: 3} + m_Name: ContentDirectoryRoot + m_EditorClassIdentifier: Assembly-CSharp::DirectScriptableObjectReference + references: + - key: LoadableAudioClipReference + value: {fileID: 11400000, guid: 4038ff673d390134d924b57fcbed0432, type: 2} + - key: SingleAudioClipLoadableReference + value: {fileID: 11400000, guid: 21679be819d6e9146a63bb02a7e51f2f, type: 2} + - key: SerializationDemo + value: {fileID: 11400000, guid: 78532141fd7679a458405eb16bdb75fd, type: 2} diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/ContentDirectoryRoot.asset.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/ContentDirectoryRoot.asset.meta new file mode 100644 index 0000000..7028107 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/ContentDirectoryRoot.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 52b43dad178849b42ac753005736e7bb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/DirectAudioClipReference.asset b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/DirectAudioClipReference.asset new file mode 100644 index 0000000..de7ec52 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/DirectAudioClipReference.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d6330d3e9b8e5a0439e4dd147cec19dd, type: 3} + m_Name: DirectAudioClipReference + m_EditorClassIdentifier: Assembly-CSharp::DirectAudioClipReference + clips: + - key: 6 + value: {fileID: 8300000, guid: 278c261333bf8604eb5c83790d02004d, type: 3} + - key: a + value: {fileID: 8300000, guid: b65a7916245593b4e89f4bd0aa920533, type: 3} diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/DirectAudioClipReference.asset.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/DirectAudioClipReference.asset.meta new file mode 100644 index 0000000..89251ac --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/DirectAudioClipReference.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c58476a984dba8d4897a10b387e7bc3b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/LoadableAudioClipReference.asset b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/LoadableAudioClipReference.asset new file mode 100644 index 0000000..2cfb111 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/LoadableAudioClipReference.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e747db5d2ee20ce4a9bf7f57c5b25df0, type: 3} + m_Name: LoadableAudioClipReference + m_EditorClassIdentifier: Assembly-CSharp::LoadableAudioClipReference + clips: + - key: 6 + value: + m_LoadableObjectId: {fileID: 8300000, loadable: 1, guid: 278c261333bf8604eb5c83790d02004d, type: 3} + - key: a + value: + m_LoadableObjectId: {fileID: 8300000, loadable: 1, guid: b65a7916245593b4e89f4bd0aa920533, type: 3} diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/LoadableAudioClipReference.asset.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/LoadableAudioClipReference.asset.meta new file mode 100644 index 0000000..b55f713 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/LoadableAudioClipReference.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4038ff673d390134d924b57fcbed0432 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SerializationDemo.asset b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SerializationDemo.asset new file mode 100644 index 0000000..1b1dac6 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SerializationDemo.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f44aeb02ae06dd84bb3ef76e1df8d525, type: 3} + m_Name: SerializationDemo + m_EditorClassIdentifier: Assembly-CSharp::SerializationDemo + data: + rid: 1502988012516802560 + references: + version: 2 + RefIds: + - rid: 1502988012516802560 + type: {class: SerializationDemo/SerializedData, ns: , asm: Assembly-CSharp} + data: + longValue: -1234567890123456789 + ulongValue: 12345678901234567890 + intValue: -2000000000 + uintValue: 4000000000 + shortValue: -12345 + ushortValue: 54321 + signedCharValue: -123 + unsignedCharValue: 234 + boolValue: 1 + floatValue: 3.1415927 + doubleValue: 2.718281828459045 + charValue: 90 + stringValue: SerializationDemo string value + intArray: 000000000100000002000000030000000400000005000000060000000700000008000000090000000a0000000b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e0000001f000000200000002100000022000000230000002400000025000000260000002700000028000000290000002a0000002b0000002c0000002d0000002e0000002f000000300000003100000032000000330000003400000035000000360000003700000038000000390000003a0000003b0000003c0000003d0000003e0000003f000000400000004100000042000000430000004400000045000000460000004700000048000000490000004a0000004b0000004c0000004d0000004e0000004f000000500000005100000052000000530000005400000055000000560000005700000058000000590000005a0000005b0000005c0000005d0000005e0000005f000000600000006100000062000000630000006400000065000000660000006700000068000000690000006a0000006b0000006c0000006d0000006e0000006f000000700000007100000072000000730000007400000075000000760000007700000078000000790000007a0000007b0000007c0000007d0000007e0000007f000000800000008100000082000000830000008400000085000000860000008700000088000000890000008a0000008b0000008c0000008d0000008e0000008f000000900000009100000092000000930000009400000095000000960000009700000098000000990000009a0000009b0000009c0000009d0000009e0000009f000000a0000000a1000000a2000000a3000000a4000000a5000000a6000000a7000000a8000000a9000000aa000000ab000000ac000000ad000000ae000000af000000b0000000b1000000b2000000b3000000b4000000b5000000b6000000b7000000b8000000b9000000ba000000bb000000bc000000bd000000be000000bf000000c0000000c1000000c2000000c3000000c4000000c5000000c6000000c7000000c8000000c9000000ca000000cb000000cc000000cd000000ce000000cf000000d0000000d1000000d2000000d3000000d4000000d5000000d6000000d7000000d8000000d9000000da000000db000000dc000000dd000000de000000df000000e0000000e1000000e2000000e3000000e4000000e5000000e6000000e7000000e8000000e9000000ea000000eb000000ec000000ed000000ee000000ef000000f0000000f1000000f2000000f3000000f4000000f5000000f6000000f7000000f8000000f9000000fa000000fb000000fc000000fd000000fe000000ff000000000100000101000002010000030100000401000005010000060100000701000008010000090100000a0100000b0100000c0100000d0100000e0100000f010000100100001101000012010000130100001401000015010000160100001701000018010000190100001a0100001b0100001c0100001d0100001e0100001f010000200100002101000022010000230100002401000025010000260100002701000028010000290100002a0100002b0100002c0100002d0100002e0100002f010000300100003101000032010000330100003401000035010000360100003701000038010000390100003a0100003b0100003c0100003d0100003e0100003f010000400100004101000042010000430100004401000045010000460100004701000048010000490100004a0100004b0100004c0100004d0100004e0100004f010000500100005101000052010000530100005401000055010000560100005701000058010000590100005a0100005b0100005c0100005d0100005e0100005f010000600100006101000062010000630100006401000065010000660100006701000068010000690100006a0100006b0100006c0100006d0100006e0100006f010000700100007101000072010000730100007401000075010000760100007701000078010000790100007a0100007b0100007c0100007d0100007e0100007f010000800100008101000082010000830100008401000085010000860100008701000088010000890100008a0100008b0100008c0100008d0100008e0100008f010000900100009101000092010000930100009401000095010000960100009701000098010000990100009a0100009b0100009c0100009d0100009e0100009f010000a0010000a1010000a2010000a3010000a4010000a5010000a6010000a7010000a8010000a9010000aa010000ab010000ac010000ad010000ae010000af010000b0010000b1010000b2010000b3010000b4010000b5010000b6010000b7010000b8010000b9010000ba010000bb010000bc010000bd010000be010000bf010000c0010000c1010000c2010000c3010000c4010000c5010000c6010000c7010000c8010000c9010000ca010000cb010000cc010000cd010000ce010000cf010000d0010000d1010000d2010000d3010000d4010000d5010000d6010000d7010000d8010000d9010000da010000db010000dc010000dd010000de010000df010000e0010000e1010000e2010000e3010000e4010000e5010000e6010000e7010000e8010000e9010000ea010000eb010000ec010000ed010000ee010000ef010000f0010000f1010000f2010000f3010000f4010000f5010000f6010000f7010000f8010000f9010000fa010000fb010000fc010000fd010000fe010000ff010000i diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SerializationDemo.asset.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SerializationDemo.asset.meta new file mode 100644 index 0000000..783f266 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SerializationDemo.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 78532141fd7679a458405eb16bdb75fd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipDirectReference.asset b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipDirectReference.asset new file mode 100644 index 0000000..b75d4c7 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipDirectReference.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d6330d3e9b8e5a0439e4dd147cec19dd, type: 3} + m_Name: SingleAudioClipDirectReference + m_EditorClassIdentifier: Assembly-CSharp::DirectAudioClipReference + clips: + - key: a + value: {fileID: 8300000, guid: b65a7916245593b4e89f4bd0aa920533, type: 3} diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipDirectReference.asset.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipDirectReference.asset.meta new file mode 100644 index 0000000..3a3739c --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipDirectReference.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0bfc83564a9c3024bb15ff70c58eef45 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset new file mode 100644 index 0000000..ddfef90 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset @@ -0,0 +1,18 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e747db5d2ee20ce4a9bf7f57c5b25df0, type: 3} + m_Name: SingleAudioClipLoadableReference + m_EditorClassIdentifier: Assembly-CSharp::LoadableAudioClipReference + clips: + - key: a + value: + m_LoadableObjectId: {fileID: 8300000, loadable: 1, guid: b65a7916245593b4e89f4bd0aa920533, type: 3} diff --git a/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset.meta b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset.meta new file mode 100644 index 0000000..d31efc1 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/ScriptableObjects/SingleAudioClipLoadableReference.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21679be819d6e9146a63bb02a7e51f2f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/Scripts.meta b/UnityProjects/LeadingEdge/Assets/Scripts.meta new file mode 100644 index 0000000..f0df28a --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46f0b295c1a77cf42bf0e89b8fa690b1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/DirectAudioClipReference.cs b/UnityProjects/LeadingEdge/Assets/Scripts/DirectAudioClipReference.cs new file mode 100644 index 0000000..09cc247 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/DirectAudioClipReference.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using UnityEngine; + +// References AudioClips through a serialized Dictionary, creating direct (strong) references. +// All referenced clips are loaded immediately when this asset is loaded. +public class DirectAudioClipReference : ScriptableObject +{ + [SerializeField] + public Dictionary clips = new Dictionary(); +} diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/DirectAudioClipReference.cs.meta b/UnityProjects/LeadingEdge/Assets/Scripts/DirectAudioClipReference.cs.meta new file mode 100644 index 0000000..b0e8317 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/DirectAudioClipReference.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d6330d3e9b8e5a0439e4dd147cec19dd \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/DirectScriptableObjectReference.cs b/UnityProjects/LeadingEdge/Assets/Scripts/DirectScriptableObjectReference.cs new file mode 100644 index 0000000..f9afb36 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/DirectScriptableObjectReference.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using UnityEngine; + +// References other ScriptableObjects through a serialized Dictionary, creating direct (strong) references. +// Used as a root asset that aggregates several leaf reference assets. +public class DirectScriptableObjectReference : ScriptableObject +{ + [SerializeField] + public Dictionary references = new Dictionary(); +} diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/DirectScriptableObjectReference.cs.meta b/UnityProjects/LeadingEdge/Assets/Scripts/DirectScriptableObjectReference.cs.meta new file mode 100644 index 0000000..d30e39d --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/DirectScriptableObjectReference.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8623c5efbb626994da80931050f0aba0 \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/LoadableAudioClipReference.cs b/UnityProjects/LeadingEdge/Assets/Scripts/LoadableAudioClipReference.cs new file mode 100644 index 0000000..e93fcbc --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/LoadableAudioClipReference.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using Unity.Loading; +using UnityEngine; + +// References AudioClips through a serialized Dictionary of Loadable, creating on-demand (weak) +// references. The clips are included in the build but loaded only when code requests them. +public class LoadableAudioClipReference : ScriptableObject +{ + [SerializeField] + public Dictionary> clips = new Dictionary>(); +} diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/LoadableAudioClipReference.cs.meta b/UnityProjects/LeadingEdge/Assets/Scripts/LoadableAudioClipReference.cs.meta new file mode 100644 index 0000000..7890ab0 --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/LoadableAudioClipReference.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e747db5d2ee20ce4a9bf7f57c5b25df0 \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/SerializationDemo.cs b/UnityProjects/LeadingEdge/Assets/Scripts/SerializationDemo.cs new file mode 100644 index 0000000..fe3d4af --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/SerializationDemo.cs @@ -0,0 +1,37 @@ +using System; +using UnityEngine; + +// Reference asset exercising Unity serialization of a range of primitive types, an array and a string. +// Useful for systematically testing the UnityDataTool `dump` command against known field layout and values. +public class SerializationDemo : ScriptableObject +{ + // Held through a managed reference so the data is serialized as a referenced object rather than inline. + [SerializeReference] + public SerializedData data; + + [Serializable] + public class SerializedData + { + public long longValue = -1234567890123456789L; + public ulong ulongValue = 12345678901234567890UL; + public int intValue = -2000000000; + public uint uintValue = 4000000000U; + public short shortValue = -12345; + public ushort ushortValue = 54321; + public sbyte signedCharValue = -123; // C++ "signed char" + public byte unsignedCharValue = 234; // C++ "unsigned char" + public bool boolValue = true; + public float floatValue = 3.1415927f; + public double doubleValue = 2.718281828459045; + public char charValue = 'Z'; + public string stringValue = "SerializationDemo string value"; + public int[] intArray; + + public SerializedData() + { + intArray = new int[512]; + for (int i = 0; i < intArray.Length; i++) + intArray[i] = i; + } + } +} diff --git a/UnityProjects/LeadingEdge/Assets/Scripts/SerializationDemo.cs.meta b/UnityProjects/LeadingEdge/Assets/Scripts/SerializationDemo.cs.meta new file mode 100644 index 0000000..a890eae --- /dev/null +++ b/UnityProjects/LeadingEdge/Assets/Scripts/SerializationDemo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f44aeb02ae06dd84bb3ef76e1df8d525 \ No newline at end of file diff --git a/UnityProjects/LeadingEdge/CLAUDE.md b/UnityProjects/LeadingEdge/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/UnityProjects/LeadingEdge/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md