Created
January 18, 2021 20:06
-
-
Save rondinellimorais/7268adb2a019290d283471274eae3e8f to your computer and use it in GitHub Desktop.
change_material.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ToggleImage(Renderer renderer, string base64String) | |
{ | |
Texture2D texture2D = new Texture2D(1, 1); | |
byte[] bytes = Convert.FromBase64String(base64String); | |
texture2D.LoadImage(bytes); | |
texture2D.Apply(); | |
renderer.material.mainTexture = texture2D; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment