public override void OnStart(PartModule.StartState state) { base.OnStart(state); // Initialize stuff managedResourceNames = new List <string>(); managedTransformNames = new List <string>(); managedStackNodeIDs = new List <string>(); MaxTempManaged = false; SkinMaxTempManaged = false; AttachNodeManaged = false; for (int i = 0; i < subtypes.Count; i++) { PartSubtype subtype = subtypes[i]; subtype.SetParent(this); subtype.OnStart(); TankType tank = subtype.tankType; if (tank == null) { LogError("Tank is null on subtype " + subtype.Name); } if (tank.ResourcesCount > 0 && (TankVolumeForSubtype(i) <= 0f)) { LogError("Subtype " + subtype.Name + " has a tank type with resources, but no volume is specifified"); subtype.tankType = tank = B9TankSettings.StructuralTankType; } if (tank != null) { managedResourceNames.AddRange(tank.ResourceNames); } managedTransformNames.AddRange(subtype.transformNames); managedStackNodeIDs.AddRange(subtype.NodeIDs); if (subtype.maxTemp > 0f) { MaxTempManaged = true; } if (subtype.skinMaxTemp > 0f) { SkinMaxTempManaged = true; } if (subtype.attachNode.IsNotNull()) { if (part.attachRules.allowSrfAttach && part.srfAttachNode != null) { AttachNodeManaged = true; } else { LogError("Error: Part subtype '" + subtype.Name + "' has an attach node defined, but part does not allow surface attachment (or the surface attach node could not be found)"); } } } if (currentSubtypeIndex >= subtypes.Count || currentSubtypeIndex < 0) { currentSubtypeIndex = 0; } bool editor = (state == StartState.Editor); SetupGUI(); for (int i = 0; i < subtypes.Count; i++) { subtypes[i].DeactivateObjects(); if (editor) { subtypes[i].DeactivateNodes(); } else { subtypes[i].ActivateNodes(); } } UpdateSubtype(false); }