Skip to content

Instantly share code, notes, and snippets.

@Santarh
Santarh / SaveTexture.cs
Created January 20, 2020 17:27
[Unity] Get PNG bytes from RenderTexture with Color Conversion.
using UnityEngine;
public class SaveTexture : MonoBehaviour
{
private byte[] SaveRenderTextureAsPng(RenderTexture rt)
{
if (rt == null || !rt.IsCreated()) return null;
// Allocate