I have a function which will return me an object array with different types in each element. This is a small reproducer of what i am trying to achieve.
public static object[] asset()
{
object[] tab = new object[11];
tab[0] = bool;
tab[1] = int;
tab[2] = int;
tab[3] = int;
tab[4] = int;
tab[5] = int;
tab[6] = string;
tab[7] = double;
tab[8] = float;
tab[9] = int;
tab[10] = ""; //string
return tab;
}
object[] testobject = new object[11];
testobject = asset();
If (testobject[0] = true)
{
}
So i am trying to performe a bool check to the object[0] which is a bool. Obviously it doesn't work like this. I tried converting object[0] to boolean and then test it which is what i do for integers or doubles but it doesn't work neither.
Any ideas?
If (testobject[0] = true), use lower case if and use==to compare, not=.object.