Which Built-ins are Serializable?

I have discovered that uint[,] does not appear to be serializable, but many other built-ins, such as uint[], are.

Is there a comprehensive list of what is serializable and what is not?

Is there any way for me to somehow extend uint[,] so that it is serializable (short of making a wrapper class)?

See the documentation of the [SerializeField attribute][1]. It has a list of types which are supported, however it’s not complete. It says it can serialize arrays of a serializable type, however only one-dimensional arrays. Multidimensional arrays, like in your example, aren’t supported.

You can implement the relatively new [ISerializationCallbackReceiver][2]. It allows you to do some preperations before Untiy serializes your class and after it deserialized it.

Example:

public class SomeClass : MonoBehaviour, ISerializationCallbackReceiver
{
    public uint[,] theArray;

    [SerializeField, HideInInspector]
    private uint[] m_internal;

    [SerializeField, HideInInspector]
    private int m_FirstDimSize;

    public void OnAfterDeserialize()
    {
        if (m_internal == null)
            return;
        int dim2 = m_internal.Length / m_FirstDimSize;
        theArray = new uint[m_FirstDimSize, dim2];
        for(int i = 0; i < m_internal.Length; i++)
        {
            theArray[i % m_FirstDimSize, i / m_FirstDimSize] = m_internal*;*

}
}

public void OnBeforeSerialize()
{
m_internal = null;
if (theArray == null)
return;
m_FirstDimSize = theArray.GetLength(0);
int dim2 = theArray.GetLength(1);
int size = m_FirstDimSize * dim2;
m_internal = new uint;
for (int i = 0; i < size; i++)
{
m_internal = theArray[i % m_FirstDimSize, i / m_FirstDimSize];
}
}
}
edit
Of course this only takes care of serializing the data. You still have to create your array on your own. You might want to implement a custom inspector for your class. In general it’s better to avoid types which aren’t serializable if you want to edit them in the inspector.
Alternatively you can use a nested type like this:
[System.Serializable]
public class InnerArray
{
public uint[] columns;
}

public class SomeClass2 : MonoBehaviour
{
public InnerArray[] theArray;
}
This will actually create a jagged array but it’s serializable by Unity. You can access your values like this:
uint v = theArray[rowIndex].columns[columnIndex];
instead of
uint v = theArray[rowIndex, columnIndex];
second edit
Your inner class can also declare an indexer. That way you could use it more easily:
[System.Serializable]
public class InnerArray
{
public uint[] columns;
public uint this[aIndex]
{
get { return columns[aIndex]; }
set { columns[aIndex] = value; }
}
}
Now you can access a value in the datastructure like this:
uint v = theArray[rowIndex][columnIndex];
This is almost like using a multidim array ^^
_[1]: http://docs.unity3d.com/ScriptReference/SerializeField.html*_
_
[2]: http://docs.unity3d.com/ScriptReference/ISerializationCallbackReceiver.html*_