Hi guys im using a plugin to import an image on mobile phones.
It’s imported as a callback with Texture2D ref.
If my code is the following:
private Texture2D importedTexture; //the image user imports
private Sprite selectedImage = null; //selected image
importedTexture = callback.texture;
selectedImage = Sprite.Create(importedTexture, new Rect(0.0f, 0.0f, importedTexture.width, importedTexture.height), new Vector2(0.5f, 0.5f));
Later on I call
Destroy(selectedImage);
I have done testing and the created sprite is indeed gone.
but do i also have to call Destroy(importedTexture)?
I can’t get a clear answer from the profiler.
appreciate any help thanks.