The document describes the evolution of a Unity project that spawns cars from prefabs over time. It starts by spawning directly from prefabs, then loads from Resources, then loads asynchronously from Resources. It then moves to building asset bundles and loading from them, both locally and remotely. Over time the code gets more robust, handling dependencies and loading asset bundles from a CDN. This reflects the ongoing process of improving systems and adapting to new needs and technologies.
45. Bundle Build Pipeline Overhaul Sneak Peak
public static AssetBundleBuildInput
GenerateAssetBundleBuildInput(
AssetBundleBuildSettings settings) { … }
public struct AssetBundleBuildInput
{
public struct Definition
{
public string name;
public string variant;
public GUID[] assets;
}
public AssetBundleBuildSettings settings;
public Definition[] bundles;
}
* Input generated from asset importer meta
data or any other source (external tools, etc.)
46. Bundle Build Pipeline Overhaul Sneak Peak
public static AssetBundleBuildCommandSet
GenerateAssetBuildCommandSet(
AssetBundleBuildInput buildInput) { … }
public struct AssetBundleBuildCommandSet
{
public struct Command
{
public AssetBundleBuildInput.Definition input;
public ObjectIdentifier[] objectsToBeWritten;
}
public AssetBundleBuildSettings settings;
public Command[] commands;
}
Command set generation gathers all
dependencies, handles object stripping, and
generates full list of objects to write.
47. Bundle Build Pipeline Overhaul Sneak Peak
public static void SaveAssetBundleOutput(AssetBundleBuildOutput output) { … }
Output can be serialized to JSON or any other
format as required.
48. Bundle Build Pipeline Overhaul Sneak Peak
public static void SaveAssetBundleOutput(AssetBundleBuildOutput output) { … }
Put it all together …
// Default build pipeline
SaveAssetBundleOutput(ExecuteAssetBuildCommandSet(GenerateAssetBuildComma
ndSet(GenerateAssetBundleBuildInput(settings))));