In my code I have a list of a object I created. That object is two Int’s and a Vector3 object. Upon creation each object is stored to a list. However, such list maxes out at 90 values. Every element after Index = 89 is null.
Is there any kind of limitation in Unity about list sizes ?
Object Class
public class Hexagons
{
public Color HexBackgroundColor { get; set; }
public Vector2 Center { get; set; }
public GameObject Troop { get; set; }
public float BonusATK { get; set; }
public float BonusDEF { get; set; }
public static Hexagons CreateHex(Color HexBackgroundColor,float xPos, float yPos)
{
//Assignement is done in here
Hexagons x = new Hexagons (HexBackgroundColor, xPos, yPos);
GlobalVariables.HexCenters.Add (x.Center);
GlobalVariables.Hexes.Add (x);
return x;
}
private Hexagons(Color HexBackgroundColor,float xPos, float yPos)
{
this.Center = new Vector2 (xPos, yPos);
GameObject.Instantiate (GameObject.Find ("HexTile"), new Vector3 (xPos, yPos), new Quaternion ());
this.BonusATK = Mathf.RoundToInt(GlobalVariables.Rand.Next (0, 3000));
this.BonusDEF = Mathf.RoundToInt(GlobalVariables.Rand.Next (0, 3000));
}
}
Edit : Added asignement code