public enum MyState
{
A,B,C
}
public class ABC
{
int length;
}
public List<ABC> abcs = new List<ABC>();
public MyState state = MyState.A;
void Start()
{
for(int i = 0 i < 5;i++)
{
ABC temp = new ABC();
tmp.length = 1 + i;
abcs.add(temp);
}
}
void Update(){
foreach(ABC a in abcs)
{
if(a.length == 1)
state = MyState.B;
}
}
I want to change my custom enum when one is satisfy my condition in collection.
But only last one in collection will do , how to solve it ?
Thanks in advance.