AssetRefs
The Asset(displayPath[, subAssetName]) and Builtin(name[, typeHint]) authoring factories. Bring them into scope with using static SceneBuilder.Authoring.AssetRefs; and reference an asset from any serialized asset field: c.Set("m_Materials", new[] { Asset("Assets/Materials/Red.mat") }), c.Set("m_Mesh", Asset("Assets/Models/Barrel.fbx", "BarrelMesh")), or c.Set("m_Mesh", Builtin("Cube")). Author a cleared field with Asset(null).
public static class AssetRefsCompile-time scaffolding only — the parser reads the source text, so these return an inert handle and perform no work at runtime.
Members
Assetstaticmethod2 overloads
public static AssetReference Asset(string displayPath)Reference the project asset at displayPath (resolved to its GUID at build time). Pass null to author a cleared / None reference.
public static AssetReference Asset(string displayPath, string subAssetName)Reference the sub-object named subAssetName inside the imported project asset at displayPath (e.g. a Mesh inside an FBX, a sub-material, a sliced Sprite), resolved to the sub-object's GUID + local file identifier at build time.
Builtinstaticmethod2 overloads
public static AssetReference Builtin(string name)Reference the Unity built-in resource named name (resolved from the editor's built-in resource containers at build time).
public static AssetReference Builtin(string name, string typeHint)Reference the Unity built-in resource named name, qualified by typeHint (the concrete type name, e.g. "Sprite") to disambiguate names shared by more than one built-in object.