Class Texture2DExtensions
Unity Texture2D
extension methods.
Inheritance
System.Object
Texture2DExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation.Extensions
Assembly: cs.temp.dll.dll
Syntax
public static class Texture2DExtensions
Methods
CreateSprite(Texture2D)
Create new sprite instance for the texture.
Declaration
public static Sprite CreateSprite(this Texture2D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | A texture to created sprite from. |
Returns
Type | Description |
---|---|
Sprite | New sprite instance. |
LoadFromBase64(Texture2D, String)
Loads texture content from base64 string.
Declaration
public static Texture2D LoadFromBase64(this Texture2D texture, string base64EncodedString)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Texture to load image content into. |
System.String | base64EncodedString | Base64 string image representation. |
Returns
Type | Description |
---|---|
Texture2D | Updated texture. |
ToBase64(Texture2D)
Convert
Declaration
public static string ToBase64(this Texture2D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Texture to convert. |
Returns
Type | Description |
---|---|
System.String | Converted texture as base64 string |