void SwitchToNextVessel()
{
bool switchNext = false;
foreach(var wm in wmgrsA)
{
if(switchNext)
{
FlightGlobals.ForceSetActiveVessel(wm.vessel);
return;
}
else if(wm.vessel.isActiveVessel)
{
switchNext = true;
}
}
foreach(var wm in wmgrsB)
{
if(switchNext)
{
FlightGlobals.ForceSetActiveVessel(wm.vessel);
return;
}
else if(wm.vessel.isActiveVessel)
{
switchNext = true;
}
}
if(wmgrsA.Count > 0 && wmgrsA[0] && !wmgrsA[0].vessel.isActiveVessel)
{
FlightGlobals.ForceSetActiveVessel(wmgrsA[0].vessel);
}
else if(wmgrsB.Count > 0 && wmgrsB[0] && !wmgrsB[0].vessel.isActiveVessel)
{
FlightGlobals.ForceSetActiveVessel(wmgrsB[0].vessel);
}
}