Interface IViewPreviewRenderer
One view kind's own live-render and wireframe drawing, so SerenityUiPreviewWindow (the
preview HOST) dispatches to whichever renderer claims the definition in focus instead of switching on
its concrete type. A view kind whose own editor assembly cannot be referenced back by the Ui editor
assembly (Leaderboard, Achievements, …) registers its renderer by simply declaring a public,
parameterless-constructible implementation — ViewPreviewRendererRegistry discovers it
across assemblies via Serenity.Global.Infrastructure.Editor.EditorTypeDiscovery, the same
way SignalFlowScanner discovers [AutoRegisterEventAction] reactions and
AchievementConditionTypeMenu discovers condition node types.
Namespace: Serenity.Ui.Infrastructure.Editor.Preview
Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
Syntax
public interface IViewPreviewRenderer
Properties
SupportsWireframe
Whether this renderer draws a structural wireframe, or the host shows a placeholder instead.
Declaration
bool SupportsWireframe { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ViewKindLabel
The toolbar dropdown group label this renderer's definitions are listed under, e.g. "Menus".
Declaration
string ViewKindLabel { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
CanRender(UnityViewDefinition)
Whether this renderer knows how to draw definition.
Declaration
bool CanRender(UnityViewDefinition definition)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityViewDefinition | definition | The definition in focus. |
Returns
| Type | Description |
|---|---|
| bool |
DrawWireframe(PreviewWireframeContext)
Draws one structural-wireframe frame. Never called when SupportsWireframe is false.
Declaration
IReadOnlyList<WireframeOptionHit> DrawWireframe(PreviewWireframeContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| PreviewWireframeContext | context | The wireframe inputs. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<WireframeOptionHit> | The option rows drawn, for the host to hit-test/navigate clicks against. |
Render(PreviewRenderContext)
Builds one live-render frame under CanvasRoot.
Declaration
PreviewRenderResult Render(PreviewRenderContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| PreviewRenderContext | context | The render inputs. |
Returns
| Type | Description |
|---|---|
| PreviewRenderResult | What the host overlays/hit-tests/paints for this frame. |