Class BaseRenderCapturer
An abstract MonoBehaviour class for capturing the render result of another component and writing it to disk as a texture
Inherited Members
Namespace: Unity.StreamingImageSequence
Syntax
public abstract class BaseRenderCapturer : MonoBehaviour
Fields
m_rt
The internal RenderTexture which is used as a target in the capturing process.
Declaration
protected RenderTexture m_rt
Field Value
| Type | Description |
|---|---|
| RenderTexture |
Methods
BeginCaptureV()
Prepare the component for capturing. May require several frames
Declaration
public abstract IEnumerator BeginCaptureV()
Returns
| Type | Description |
|---|---|
| IEnumerator | The current position of the begin process |
CanCaptureV()
Can the capturer perform the capturing process
Declaration
public abstract bool CanCaptureV()
Returns
| Type | Description |
|---|---|
| Boolean | True if capturing can be executed, false otherwise |
CaptureToFile(String, RenderCacheOutputFormat)
Capture the contents of RenderTexture to file
Declaration
[Obsolete("Replaced by TryCaptureToFile()")]
public void CaptureToFile(string outputFilePath, RenderCacheOutputFormat outputFormat = RenderCacheOutputFormat.PNG)
Parameters
| Type | Name | Description |
|---|---|---|
| String | outputFilePath | The path of the file |
| RenderCacheOutputFormat | outputFormat | The output file format |
EndCaptureV()
Clean up the component after capturing
Declaration
public abstract void EndCaptureV()
GetInternalTexture()
Gets the internal texture used for the capturing process
Declaration
public Texture GetInternalTexture()
Returns
| Type | Description |
|---|---|
| Texture | The internal texture |
GetLastErrorMessage()
Get the last error message.
Declaration
public string GetLastErrorMessage()
Returns
| Type | Description |
|---|---|
| String | The last error message |
ReleaseRenderTexture()
Release Render Texture
Declaration
protected void ReleaseRenderTexture()
SetErrorMessage(String)
Set error message, which will be displayed if there is any error detected during the capturing process.
Declaration
protected void SetErrorMessage(string err)
Parameters
| Type | Name | Description |
|---|---|---|
| String | err | The error message |
TryCaptureToFile(String, RenderCacheOutputFormat)
Capture the contents of RenderTexture to file
Declaration
public bool TryCaptureToFile(string outputFilePath, RenderCacheOutputFormat outputFormat = RenderCacheOutputFormat.PNG)
Parameters
| Type | Name | Description |
|---|---|---|
| String | outputFilePath | The path of the file |
| RenderCacheOutputFormat | outputFormat | The output file format |
Returns
| Type | Description |
|---|---|
| Boolean | True if successful, false otherwise |
UpdateRenderTextureV()
Updates the render texture used for the capturing process
Declaration
[CanBeNull]
protected abstract RenderTexture UpdateRenderTextureV()
Returns
| Type | Description |
|---|---|
| RenderTexture | The updated render texture if successful, null otherwise |