- Home /
Question by
byerdelen · Jun 02, 2014 at 02:08 AM ·
classesgeneric list
Changing size of the generic list classes
Hi, I have a generic array class and it works fine like below.
public class Main : MonoBehaviour
{
[System.Serializable]
public class arrayData
{
[System.Serializable]
public class arrayData2
{
}
public List<arrayData2> Levels;
}
public List<arrayData> Zones;
}
However I can not add the same empty elements of it like new Zones element or Levels element inside a Zone. I tried many variations like Zones.Add(new Zones). I tried creating another array class and add it inside but then the class names cannot be the duplicate. I tried adding forexample the first element of Zones class as a new element but then later it is copying everything to the new class what the first element had. I can Remove it with xxx.RemoveAt() though. Also I want to see it on Editor so I do not want to take of the Serializable attribute out. Someone has any idea how I can add new Zones class? Thanks
Comment