void DeployLandingGears() { //new-style landing legs are activated by an event: //vessel.rootPart.SendEvent("LowerLeg"); //old-style landings legs are activated on part activation: for (int i = 0; i < vessel.parts.Count; i++) { Part p = vessel.parts[i]; if (p.HasModule <ModuleLandingLeg>()) { if (p.inverseStage >= limitGearsStage) { foreach (ModuleLandingLeg l in p.FindModulesImplementing <ModuleLandingLeg>()) { l.LowerLeg(); } } } if (p is LandingLeg) { LandingLeg l = (LandingLeg)p; if (l.legState == LandingLeg.LegStates.RETRACTED) { l.DeployOnActivate = true; l.force_activate(); } } } deployedGears = true; }
void DeployLandingGears() { //new-style landing legs are activated by an event: vessel.rootPart.SendEvent("LowerLeg"); //old-style landings legs are activated on part activation: foreach (Part p in vessel.parts) { if (p is LandingLeg) { LandingLeg l = (LandingLeg)p; if (l.legState == LandingLeg.LegStates.RETRACTED) { l.DeployOnActivate = true; l.force_activate(); } } } deployedGears = true; }