public override void OnStart(StartState state) { if (state != StartState.Editor && vessel != null) { part.force_activate(); instance = this; if (part.FindModulesImplementing <ModuleHullBreach>().Count != 0) { config.Instance.vesselHullBreach = this; } } if (!crushable) { Fields["crushDepth"].guiActive = false; Fields["crushDepth"].guiActiveEditor = false; } else { Fields["flowMultiplier"].guiActive = false; Fields["flowMultiplier"].guiActiveEditor = false; } //if (state != StartState.Editor & vessel != null & partDebug == false) //hiding info fields for troubleshooting //foreach (BaseField f in Fields) { f.guiActive = false; } ??? //{ //Fields["Submerged Portion"].guiActive = false; //Fields["Current Situation"].guiActive = false; //Fields["Heat Level"].guiActive = false; //Fields["Current Depth"].guiActive = false; //Fields["Current Altitude"].guiActive = false; //} // GameEvents.onVesselStandardModification.Add(triggerCatastrophicBreach); // onVesselStandardModification collects various vessel events and fires them off with a single one. // Specifically - onPartAttach,onPartRemove,onPartCouple,onPartDie,onPartUndock,onVesselWasModified,onVesselPartCountChanged // List<Part> HullParts = new List<Part>(); // GameEvents.onVesselPartCountChanged.Add(triggerCatastrophicBreach); //if(part.Modules.Contains("ModuleHullBreach")) GameEvents.onPartJointBreak.Add(CheckCatastrophicBreach); }
public override void OnStart(StartState state) { if (state != StartState.Editor && vessel != null) { part.force_activate(); instance = this; if (part.FindModulesImplementing <ModuleHullBreach>().Count != 0) { config.Instance.vesselHullBreach = this; } } if (!crushable) { Fields["crushDepth"].guiActive = false; Fields["crushDepth"].guiActiveEditor = false; } else { Fields["flowMultiplier"].guiActive = false; Fields["flowMultiplier"].guiActiveEditor = false; } }
public void OnDestroy() { instance = null; }