logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class PreviewRenderContext

    Everything an IViewPreviewRenderer needs to build one live-render frame: the definition to render, the theme supplying visuals, the canvas root to build under (already sized to ReferenceResolution), the selected option, and how to resolve a SWITCHER's active child — the one piece of window-owned interaction state (a wireframe tab click) a composite renderer must agree with the wireframe path on.

    Inheritance
    object
    PreviewRenderContext
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Ui.Infrastructure.Editor.Preview
    Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
    Syntax
    public sealed class PreviewRenderContext

    Constructors

    PreviewRenderContext(UnityViewDefinition, UnityUiThemeDefinition, RectTransform, Vector2Int, int, Func<UnityCompositeViewDefinition, IReadOnlyList<UnityCompositeViewChild>, string>)

    Declaration
    public PreviewRenderContext(UnityViewDefinition definition, UnityUiThemeDefinition theme, RectTransform canvasRoot, Vector2Int referenceResolution, int selectedOptionIndex, Func<UnityCompositeViewDefinition, IReadOnlyList<UnityCompositeViewChild>, string> resolveActiveChild)
    Parameters
    Type Name Description
    UnityViewDefinition definition
    UnityUiThemeDefinition theme
    RectTransform canvasRoot
    Vector2Int referenceResolution
    int selectedOptionIndex
    Func<UnityCompositeViewDefinition, IReadOnlyList<UnityCompositeViewChild>, string> resolveActiveChild

    Fields

    CanvasRoot

    The canvas root to build content under, already sized to ReferenceResolution.

    Declaration
    public readonly RectTransform CanvasRoot
    Field Value
    Type Description
    RectTransform

    Definition

    The definition to render.

    Declaration
    public readonly UnityViewDefinition Definition
    Field Value
    Type Description
    UnityViewDefinition

    ReferenceResolution

    The reference resolution the canvas root is sized to, in canvas units.

    Declaration
    public readonly Vector2Int ReferenceResolution
    Field Value
    Type Description
    Vector2Int

    ResolveActiveChild

    Resolves a SWITCHER's active child id (window override → initial → first).

    Declaration
    public readonly Func<UnityCompositeViewDefinition, IReadOnlyList<UnityCompositeViewChild>, string> ResolveActiveChild
    Field Value
    Type Description
    Func<UnityCompositeViewDefinition, IReadOnlyList<UnityCompositeViewChild>, string>

    SelectedOptionIndex

    Which option shows the selection highlight.

    Declaration
    public readonly int SelectedOptionIndex
    Field Value
    Type Description
    int

    Theme

    The theme whose prefab templates supply the visuals.

    Declaration
    public readonly UnityUiThemeDefinition Theme
    Field Value
    Type Description
    UnityUiThemeDefinition
    In this article
    © 2026 Serenity. All Rights Reserved