API reference

The authoring surface.

A scene is a C# class implementing ISceneDefinition. Everything you can say inside Build is on this page.

MainMenu.csC#
public class MainMenu : ISceneDefinition
{
    public void Build(SceneRoot scene) =>
        scene.Add("Hello").Transform(pos: (0, 1, 0));
}

Namespace SceneBuilder.Authoring · assembly SceneBuilder.Authoring · generated from source

Components

Editor-only behaviours you attach with a single NodeHandle call. Each pairs with the builder method shown beside it.

  • Betweenclass

    Editor-time (and play-mode-guarded) single-axis corridor placement. Drives transform.position along one axis so a sibling Renderer's bounds land flush against…

    public NodeHandle Between(SceneObjectHandle from, SceneObjectHandle to, float fraction, Between.Axis axis, SceneObjectHandle alongOrientationOf = null)
  • FitSizeclass

    Editor-time (and play-mode-guarded) world-size solver. Drives transform.localScale from a sibling MeshFilter's local bounds so an authored width/height/depth…

    public NodeHandle FitSize(float? width = null, float? height = null, float? depth = null)
  • SurfaceSnapclass

    Editor-time (and play-mode-guarded) world-bounds snap. Drives transform.position on the set world axes so a sibling Renderer's world bounds face lands flush…

    public NodeHandle SurfaceSnap(bool up = false, bool down = false, bool left = false, bool right = false, bool forward = false, bool back = false, SceneObjectHandle target = null)

Types

  • AssetReferenceclass

    The value produced by the AssetRefs.Asset, AssetRefs.Asset, AssetRefs.Builtin, or AssetRefs.Builtin authoring factories — an asset reference authored by either…

  • AssetRefsclass

    The Asset(displayPath[, subAssetName]) and Builtin(name[, typeHint]) authoring factories. Bring them into scope with using static…

  • ComponentHandle<T>class

    A handle to a component being authored on a GameObject (via NodeHandle.Component). Set serialized fields either by serialized property path (c.Set("m_Mass",…

  • ComponentRef<T>class

    A reference to an already-declared component, captured with NodeHandle.Ref and passed as a UnityEvent listener target. Reference-only: it exposes no…

  • IPrefabDefinitioninterface

    A Unity prefab defined in code. SceneBuilder parses the Build method (it does not execute it) and materializes the described prefab, then keeps code and prefab…

  • IPrefabVariantDefinitioninterface

    A prefab variant defined in code: a base prefab plus a set of root-level overrides, authored without re-declaring the base prefab's hierarchy. SceneBuilder…

  • ISceneDefinitioninterface

    A Unity scene defined in code. SceneBuilder parses the Build method (it does not execute it) and materializes the described scene, then keeps code and scene in…

  • InstanceHandleclass

    A handle to a prefab instance in a scene definition, returned by SceneRoot.Instance / NodeHandle.Instance. Chain calls to configure the instance's root…

  • InstanceHandle<TRef>class

    A typed handle to a prefab instance, returned by SceneRoot.Instance. Carries the generated ref type TRef through the chain so On's selector can be type-checked…

  • NodeHandleclass

    A handle to a GameObject in a scene definition. Chain calls to configure it and nest children.

  • OverrideHandleclass

    A handle for authoring property overrides on a prefab instance's root, via InstanceHandle.Override. Unlike ComponentHandle<T>, a single closure can target…

  • PrefabRefclass

    Base type every generated typed prefab reference derives from — both root prefab refs (e.g. TankRef, exposed as Prefabs.Tank) and node refs for nested children…

  • PrefabRootclass

    Root of a prefab definition. Add the prefab's single root GameObject here.

  • SceneObjectHandleclass

    A handle to an object in a scene definition: a plain GameObject (NodeHandle) or a prefab instance root (InstanceHandle). Every authoring call that takes a…

  • SceneRootclass

    Root of a scene definition. Add top-level GameObjects here.

  • ScopedHandleclass

    The closure argument passed to InstanceHandle.On / InstanceHandle.On, used to author overrides scoped to a nested target inside a prefab instance's hierarchy…

  • VariantRootclass

    The root parameter of IPrefabVariantDefinition.Build — an override-only handle onto the variant's base prefab instance. There is no Add: the variant's single…

Diagnostics

The analyzer reports 12 codes while you type. See the full table.