internal static void ChangeCarSection(Train Train, int CarIndex, int SectionIndex) {
for (int i = 0; i < Train.Cars[CarIndex].CarSections.Length; i++) {
for (int j = 0; j < Train.Cars[CarIndex].CarSections[i].Elements.Length; j++) {
int o = Train.Cars[CarIndex].CarSections[i].Elements[j].ObjectIndex;
Renderer.HideObject(o);
}
}
if (SectionIndex >= 0)
{
InitializeCarSection(Train, CarIndex, SectionIndex);
for (int j = 0; j < Train.Cars[CarIndex].CarSections[SectionIndex].Elements.Length; j++)
{
int o = Train.Cars[CarIndex].CarSections[SectionIndex].Elements[j].ObjectIndex;
if (Train.Cars[CarIndex].CarSections[SectionIndex].Overlay)
{
Renderer.ShowObject(o, Renderer.ObjectType.Overlay);
}
else
{
Renderer.ShowObject(o, Renderer.ObjectType.Dynamic);
}
}
}
Train.Cars[CarIndex].CurrentCarSection = SectionIndex;
UpdateTrainObjects(Train, CarIndex, 0.0, true);
}