r4m0n

Planet Map Dumper

Mar 10th, 2013
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class Program {
  4.     public static string Test() {
  5.         PQS pPQS = FlightGlobals.currentMainBody.GetComponentInChildren<PQS>();
  6.         Texture2D[] maps = pPQS.CreateMaps(8192, 4000, false, 0, Color.white);
  7.         int i = 0;
  8.         foreach (Texture2D map in maps)
  9.         {
  10.             byte[] png = map.EncodeToPNG();
  11.             KSP.IO.File.WriteAllBytes<PQS>(png, "current_world" + i + ".png");
  12.             i++;
  13.         }
  14.         return "Done!";
  15.     }
  16. }
Add Comment
Please, Sign In to add comment