Hi,
I am attempting to create a list of classes. These classes have categories.
Each class within the same category can have a "Rival" of that same category.
I am using a nested foreach statement to find each class that is in my category and is not myself.
The classes are rather large and have a lot of inheritence, so i don't know if Unity just can handle this much data, or i have some sort of error in my code that tunnel vision is blocking.
The Function that is crashing
private void SetRivals()
{
foreach (Network network in Networks)
{
List matches = new List();
foreach (Network target in Networks)
{
if(target.Category == network.Category)
{
if(target != network)
{
matches.Add(target);
}
}
}
network.SetPossibleRivals(matches);
}
}
The Function being targetted
public void SetPossibleRivals(List matches)
{
PossibleRivals.AddRange(matches);
}
If needed, i can post the whole Class.
Thanks in advance!
↧