- Home /
how to use matrice with unity 3D
Hello everybody, I’m developing a game represented by a matrix and each pit contains a number (like mancala principle). I need the player to move and each time update the pit’s value. I thought about using matrix, 2D tables or hash tables. Would someone please give a hint or the best way to code this? Thank you.
You should only use $$anonymous$$atricies for doing Vector calculations. Use Generic Lists
Answer by manu3d · Jul 21, 2013 at 11:03 PM
Are you asking which under-the-hood object would work best to store mancala-like data? If that is the case I suspect that you should be using some built-in Arrays (i.e. one per player) or something very similar, perhaps using Generic List<>. The classes you mentioned (2D tables/hash tables) are not serialized by unity. My understanding is that if you do want to use one of those classes, you'd have to do the serialization yourself, saving/loading the data from your own files.
Arrays are not serialised either. Built-in arrays are the only serialised collection. You should never use common arrays :)
Updated answer taking in account your suggestion @Benproductions1. However, I do believe generic List are also serialized.
As far as I know, no .NET class has serialisation. I might be wrong, but generic lists definitely don't :)
huh.. I guess I just assumed that nothing in .NET was serialized... it seems that List
is one of the very few serialised .NET classes...