private bool IsDrogue(Vessel TVessel) { foreach (Part p in TVessel.Parts) { foreach (PartModule m in p.Modules) { if (m.moduleName == "FuelDrogue") { FuelDrogue Droguetemp = (FuelDrogue)m; if (!Droguetemp.IsContact && !Droguetemp.IsTarget && Droguetemp.IsDeployed && Droguetemp.IsDrogue == IsProbe) { TDrogue = p; Drogue = Droguetemp; Drogue.IsTarget = true; TriggerTransform = p.FindModelTransform("Trigger"); Debug.Log("Got" + p.name); return(true); } else { Droguetemp = null; } } } } return(false); }
public override void OnStart(PartModule.StartState state) { base.OnStart(state); //Boom this.enabled = true; this.part.force_activate(); HingeTransform = base.part.FindModelTransform("Hinge"); foreach (PartModule m in this.part.Modules) { if (m.moduleName == "FuelDrogue") { Drogue = (FuelDrogue)m; } } //Pod DrogueOriginTransform = base.part.FindModelTransform("DrogueOrigin"); DrogueTransform = base.part.FindModelTransform("Drogue"); DrogueTransform.position = DrogueOriginTransform.position; //Localization Actions["Toggle"].guiName = Localizer.Format("#AARS_ToggleBoom"); Events["Activate"].guiName = Localizer.Format("#AARS_Deployed"); Events["Deactivate"].guiName = Localizer.Format("#AARS_Retract"); Fields["DeployAngle"].guiName = Localizer.Format("#AARS_DeployAngle"); }
public void Deactivate() { IsActivate = false; Events["Deactivate"].guiActive = false; Events["Activate"].guiActive = true; IsContact = false; if (Drogue) { TDrogue = null; targetvessel = null; Drogue.IsContact = false; Drogue.IsTarget = false; Drogue = null; IsTarget = false; IsContact = false; TriggerTransform = null; } }