logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityCompositeUiViewFactory

    Builds a UnityCompositeUiView tree from an ICompositeViewDefinition. For each child slot it either hosts an existing view (resolved by id) or recurses into a nested composite, then sizes that child via the UnityLayoutBuilder. The result is a fully laid-out composite ready to show.

    Inheritance
    object
    UnityCompositeUiViewFactory
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Ui.Infrastructure.Views.Factories
    Assembly: Serenity.UnityUi.Infrastructure.dll
    Syntax
    public class UnityCompositeUiViewFactory

    Constructors

    UnityCompositeUiViewFactory(UnityLayoutBuilder, ILogService)

    Creates the factory with the layout builder and logging dependencies.

    Declaration
    public UnityCompositeUiViewFactory(UnityLayoutBuilder layoutBuilder, ILogService logService)
    Parameters
    Type Name Description
    UnityLayoutBuilder layoutBuilder

    Builder that realizes the layout model onto Unity primitives.

    ILogService logService

    Service used to report unresolved or empty child slots.

    Methods

    CreateView(ICompositeViewDefinition, Transform, Func<string, string, IViewBase>)

    Creates a composite view from definition, parented under parent and stretched to fill it.

    Declaration
    public UnityCompositeUiView CreateView(ICompositeViewDefinition definition, Transform parent, Func<string, string, IViewBase> resolveHostedView)
    Parameters
    Type Name Description
    ICompositeViewDefinition definition

    The composite definition to realize.

    Transform parent

    The transform to parent the composite root under (e.g. a canvas).

    Func<string, string, IViewBase> resolveHostedView

    Builds an owned hosted instance of a leaf view (e.g. a menu) for a child slot, given its definition id and the composite host path (the "/"-joined chain of composite definition ids from the registered root to the slot's parent). The host path lets the same definition be hosted as several independent instances, each routed under a unique id. Returns null when none exists.

    Returns
    Type Description
    UnityCompositeUiView

    The configured composite view.

    In this article
    © 2026 Serenity. All Rights Reserved