So basically I am working on the basics of perlin noise terrain generators in unity. However, I can't seem to figure out how to save the finished PNG file to disk. This isn't about changing an existing image, it is about creating a new image. Here is the affected code so far.
var byt = tex.EncodeToPNG();
System.IO.File.WriteAllBytes("Assets/test.png", byt);
This is in javascript, by the way.
I can't see what could possibly go wrong with this code. I do the very exact same thing in my screenshot-taking script. However I do this in editor-time, not game-time. Have you tried to invoke this code while in the editor rather than when the game runs?
– anon20566073