this is my first thread, so the formating is probably wrong
So, i have this big public class called Ram with my gigantic array called map. it looks like this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ram
{
public static int[,] map;
public static int mapSize;
}
karte is defined in another script like this:
void HexSkizze1()//create empty Hexmap
{
int Zone = 7, category= 10;
//Erstellen Karten Array
Ram.map = new int[Ram.mapSize, Ram.mapSize, Zone, category];
}
here’s a little explanation:
Ram.map [ X 215 , Y 412 , Zone 0 , category 0 ] = 4; // is the basic hight of the whole grid
Ram.map [ X 135 , Y 232 , Zone 2 , category 3 ] = 0; // is the type of conection prefab nessesary to connect to its right zone 3 neighbour by 10 m
i am prossesing hexagons with its borders to their neighbours thats why its 7 zones per grid
anyway, since my maps are currently created in a generator, i want to be able to teraform and want to be able to save the tarain.
so, how can i convert Ram.map into a JSON file with a format like this:
“X:0,Y:0,Zone:0,Category:0”:“5”,
“X:0,Y:0,Zone:0,Category:1”:“2”,
“X:0,Y:0,Zone:0,Category:2”:“0”,
“X:0,Y:0,Zone:0,Category:3”:“8”,
maybe somebody has a better format idea
thanks in advance
btw here is how it looks: