Skip to main content

CopyToRenderTexture

A class in Root.Township, the global namespace.

On a camera, also copies its image into a render texture when it isn't already rendering to one.

Constructors​

MemberWhat it is
CopyToRenderTexture()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private Camera cameraThe camera on this object.
private RenderTexture renderTextureTexture the image is copied into.

Methods​

2 private and internal methods
MemberWhat it is
private void Awake()Gets the camera.
private void OnRenderImage(RenderTexture src, RenderTexture dest)Copies the frame to renderTexture if the camera has no target texture, then passes it on.