public void OnDestroy() { GameEvents.onVesselWasModified.Remove(OnVesselWasModified); GameEvents.onVesselGoOffRails.Remove(OnVesselOffRails); GameEvents.onVesselGoOnRails.Remove(OnVesselOnRails); GameEvents.onVesselDestroy.Remove(OnVesselOnRails); if (InputLockManager.GetControlLock("KJRLoadLock") == ControlTypes.ALL_SHIP_CONTROLS) { InputLockManager.RemoveControlLock("KJRLoadLock"); } updatedVessels = null; vesselOffRails = null; vesselJointStrengthened = null; multiJointManager.OnDestroy(); multiJointManager = null; }
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; }