You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This script saves a sprite as PNG.usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;usingNUDev.PlusSharp;publicclassSaveSpriteAsPNG:MonoBehaviour{publicSpritesprite;// Update is called once per framevoidUpdate(){if(Input.GetKeyDown(KeyCode.S)){StartCoroutine(Capture());}}IEnumeratorCapture(){yieldreturnnewWaitForEndOfFrame();Texture2Dspr=sprite.texture;spr.SaveToPNG(Application.persistentDataPath+"/mySprite.png");}}