I want to do this:
- Create a texture with the PackageTexture funtion
- Save that texture in the project.
Please, help me.
I want to do this:
Please, help me.
I find a solution for my problem:
Texture texture = new Texture2D(maximunAtlasSize, maximunAtlasSize);
texture.PackTextures(frames, padding, maximunAtlasSize);
texture.name = "New Atlas";
texture.Apply();
if(!Directory.Exists(Application.dataPath + "/Atlases"))
Directory.CreateDirectory(Application.dataPath + "/Atlases");
FileStream fs = new FileStream(Application.dataPath + "/Atlases/" + texture.name + ".png", FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(texture.EncodeToPNG());
bw.Close();
fs.Close();
Thanks .NET :D.