public void Start() { if (!CompatibilityChecker.IsCompatible()) { return; } GameEvents.onVesselCreate.Add(OnVesselCreate); GameEvents.onVesselWasModified.Add(OnVesselWasModified); GameEvents.onVesselGoOffRails.Add(OnVesselOffRails); GameEvents.onVesselGoOnRails.Add(OnVesselOnRails); GameEvents.onVesselDestroy.Add(OnVesselOnRails); GameEvents.onPartDestroyed.Add(OnPartDestroyed); GameEvents.onPartDie.Add(OnPartDestroyed); }
public void OnDestroy() { if (!CompatibilityChecker.IsAllCompatible()) { return; } GameEvents.onVesselWasModified.Remove(OnVesselWasModified); GameEvents.onVesselGoOffRails.Remove(OnVesselOffRails); GameEvents.onVesselGoOnRails.Remove(OnVesselOnRails); if (InputLockManager.GetControlLock("KJRLoadLock") == ControlTypes.ALL_SHIP_CONTROLS) { InputLockManager.RemoveControlLock("KJRLoadLock"); } updatedVessels = null; vesselOffRailsTick = null; vesselJointStrengthened = null; multiJointManager.OnDestroy(); multiJointManager = null; }