ドキュメント

Unity Engine

Download Unity

Unity Engine

TryCaptureIntoRenderTexture(VisualElement, RenderTexture)

Renders the element's panel and captures the visual content of element into the supplied destination. Returns false when the element cannot be captured.
読み終わるまでの所要時間 1 分最終更新 25日前

Definition

public static bool TryCaptureIntoRenderTexture(this VisualElement element, RenderTexture destination)

Parameters

The element to capture.

destination

The texture to render into. The caller owns and is responsible for releasing it. The element is captured at the panel's scale and aligned to the top-left of the texture. Content that does not fit is cropped, and any uncovered region is left transparent.

Returns

Type

Description

boolReturns
true
if the capture succeeded. Returns
false
if
element
is not attached to a panel, or if the element's panel cannot be captured because it draws directly into cameras.

Remarks

This method repaints the whole panel before it captures content. It returns
false
at runtime if capturing content is not possible, for example, if the element is not attached to a panel, or if the element's panel draws directly into cameras.