Table of Contents

Class UnityExtensions

Extensions for Unity types.

public static class UnityExtensions
Inheritance
UnityExtensions

Methods

ToBase64JPEG(Texture2D)

Converts the given Texture2D to a JPEG Base64 encoded string.

public static string ToBase64JPEG(this Texture2D image)

Parameters

image Texture2D

The Texture2D.

Returns

string

The Base64 encoded string.

ToBase64PNG(Texture2D)

Converts the given Texture2D to a PNG Base64 encoded string.

public static string ToBase64PNG(this Texture2D image)

Parameters

image Texture2D

The Texture2D.

Returns

string

The Base64 encoded string.