Combine Children Dictionary in place of Hashtable?

Hi,

      In Combine Children script how to convert the hashtable to Dictionary.

and ArrayList to List? ? ?

Here is coding part of Combine children. .

void Awake()
{
Hashtable materialToMesh = new Hashtable();

ArrayList objects = (ArrayList)materialToMesh[materials[m]];
if (objects != null) 
{						objects.Add(instance);
}
else
{
objects.Add(instance);
materialToMesh.Add(materials[m], objects);objects = new ArrayList();
}

If i changed the Hashtable and ArrayList like this
Dictionary materialToMesh= new Dictionary();
List objects = (List)materialToMesh[materials[m]];

It shows and Error. .

Help me to solve this? ?

It’s because you have to tell the compiler what types of data the Dictionary is going to hold:

Dictionary<byte, object> op = new Dictionary<byte, object>();

Additionally, in order to create Lists you need to do the following:

List<float> floats = new List<float>();

@iwaldrop
Yes I Already did the same thing only. But i didn’t put in the code part so only it shows like that.
I changed that to

Dictionary<Material,Mesh> materialToMesh= new Dictionary<Material,Mesh>();	
for (int i=0;i<filters.Length;i++) {
..
..
MeshCombineUtility.MeshInstance instance = new MeshCombineUtility.MeshInstance ();
...
...
...
Material[] materials = curRenderer.sharedMaterials;
				for (int m=0;m<materials.Length;m++) {
					instance.subMeshIndex = System.Math.Min(m, instance.mesh.subMeshCount - 1);
					List<MeshCombineUtility.MeshInstance> objects = (List<MeshCombineUtility.MeshInstance>)materialToMesh[materials[m]];

But it shows an error as
Error 114 Cannot convert type ‘UnityEngine.Mesh’ to ‘System.Collections.Generic.List’