protected override void OnDisabled() { base.OnDisabled(); GameEvents.onFlightReady.Remove(VesselProtoEvents.FlightReady); GameEvents.onGameSceneLoadRequested.Remove(VesselProtoEvents.OnSceneRequested); GameEvents.OnTriggeredDataTransmission.Remove(VesselProtoEvents.TriggeredDataTransmission); GameEvents.OnExperimentStored.Remove(VesselProtoEvents.ExperimentStored); ExperimentEvent.onExperimentReset.Remove(VesselProtoEvents.ExperimentReset); PartEvent.onPartDecoupled.Remove(VesselProtoEvents.PartDecoupled); PartEvent.onPartUndocked.Remove(VesselProtoEvents.PartUndocked); PartEvent.onPartCoupled.Remove(VesselProtoEvents.PartCoupled); GameEvents.OnEVAConstructionModePartAttached.Remove(VesselProtoEvents.EVAConstructionModePartAttached); GameEvents.OnEVAConstructionModePartDetached.Remove(VesselProtoEvents.EVAConstructionModePartDetached); WarpEvent.onTimeWarpStopped.Remove(VesselProtoEvents.WarpStopped); //This is the main system that handles the vesselstore so if it's disabled clear the store too VesselProtos.Clear(); VesselsUnableToLoad.Clear(); QueuedVesselsToSend.Clear(); }
protected override void OnDisabled() { base.OnDisabled(); VesselInitializeEvent.onVesselInitialized.Remove(VesselProtoEvents.VesselInitialized); GameEvents.onFlightReady.Remove(VesselProtoEvents.FlightReady); GameEvents.onGameSceneLoadRequested.Remove(VesselProtoEvents.OnSceneRequested); GameEvents.onVesselPartCountChanged.Remove(VesselProtoEvents.VesselPartCountChanged); GameEvents.OnTriggeredDataTransmission.Remove(VesselProtoEvents.TriggeredDataTransmission); GameEvents.OnExperimentStored.Remove(VesselProtoEvents.ExperimentStored); ExperimentEvent.onExperimentReset.Remove(VesselProtoEvents.ExperimentReset); //This is the main system that handles the vesselstore so if it's disabled clear the store aswell VesselProtos.Clear(); VesselProtoEvents.QueuedVessels.Clear(); }
/// <summary> /// Removes a vessel from the system /// </summary> public void RemoveVessel(Guid vesselId) { VesselProtos.TryRemove(vesselId, out _); }