How to save an texture
How to save an texture
Hay there! I'm currently trying to save the texture on a Raw Image GUI object I have. Rite now when i try and save it it comes back missing. Is there a way to save this texture and reapply it to my Raw Image GUI object in my scene?
Re: How to save an texture
Hi,
Saved game data is serialized (i.e., converted into) a string so it can be written to storage such as a saved game file on disk. Unity doesn't serialize references to assets such as textures. One solution is to put your textures in a folder named Resources. Then write a custom saver that saves the name of the texture. When reloading your saved game, use Resources.Load<Texture2D>(name) to load the texture and assign it back to your Raw Image.
Saved game data is serialized (i.e., converted into) a string so it can be written to storage such as a saved game file on disk. Unity doesn't serialize references to assets such as textures. One solution is to put your textures in a folder named Resources. Then write a custom saver that saves the name of the texture. When reloading your saved game, use Resources.Load<Texture2D>(name) to load the texture and assign it back to your Raw Image.