public class ActiveCamera
{
public Camera camera;
public bool isActive;
}
Then create an array of that wrapper:
ActiveCamera[] cams = //etc...
Then filter the array to get the relevant object you’re looking for:
Camera current = GetCurrentCamera();
//...
Camera GetCurrentCamera()
{
Camera current = null;
for(int i = 0; i < cams.Length; i++)
{
if(cams[i].isActive)
{
current = cams[i].camera;
break;
}
}
return current;
}