List of Textures

Hi, This is what I want Any help would mean alot, really. Im stuck.

main objective of this question:

save a gameobject to device that contains a list of bytearrays.

mechanism:

Save 50 images(byte arrays) to the list. and then serialize that gameobject containing the list.

This forum is all about helping you write the script, but it is not about us writing the script for you.

What you want sounds fairly simple so what have you tried so far and how is it going?

Sure mate. I just want general idea.What i tried was encoding the texture to png and then adding it to the list and then serialize the list. but it gave a weird error(it dint work). then i read that using encodetopng gives you a byte array file. how do we make a list of byte array “file”.

This call lets you write an array of bytes to a file:

https://docs.microsoft.com/en-us/dotnet/api/system.io.file.writeallbytes

1 Like

but it creates a file, a png file at the path specified, What i was looking for to somehow get all the byte arrays in a list of bytearraysList<byte[]> Mylist= new List<byte[]>(); and then serialize the object containing the list