- Home /
Visializing a multidimensional array
hi there!
i have a big multidimensional array like int[8,11] filled with 0/1 and I want to visualize its content in gameplay while debugging.
what is the best way to do this (in c#)? thnx!
Answer by AliAzin · Mar 18, 2011 at 03:37 PM
you can build your own multidimensional int array class(a class with one int arrays ) and call "System.Serializable" on the class. then build an array of it.
like this:
[System.Serializable]
public class MultiDimensionalInt
{
public int[] intArray;
}
Then you can build an array of it in your main class like this:
public MultiDimensionalInt[] myIntArray;
That's right. However if you write your class in JS , it is Serializable by default.
Answer by DaveA · Mar 18, 2011 at 09:05 PM
If you want a 2D vis of it (rather than the tree view you'd get in the Inspector), you could make a GUI panel and use something like GUI Textures or something which would be drawn if the array cell was true. Toolbar or Grid Select might work too.
Answer by sumeetkhobare · Jul 13, 2015 at 10:40 AM
Hey,
I stumbled in this same issue a month ago and after solving it, I have made a solution to this, now. I have made a grid view for a 2D array.
You can find it here: https://youtu.be/uoHc-Lz9Lsc
Its in c# though.