void Awake() { if (HighLogic.LoadedScene != GameScenes.FLIGHT && HighLogic.LoadedScene != GameScenes.SPACECENTER && HighLogic.LoadedScene != GameScenes.TRACKSTATION) { return; } try { GameEvents.onCrewOnEva.Add(OnCrewOnEva); GameEvents.onCrewBoardVessel.Add(OnCrewBoardVessel); GameEvents.onGameStateLoad.Add(onLoad); GameEvents.onVesselRename.Add(OnRename); GameEvents.onVesselChange.Add(OnVesselChange); GameEvents.onVesselWasModified.Add(OnVesselWasModified); GameEvents.OnGameSettingsApplied.Add(GameSettingsApplied); GameEvents.onVesselLoaded.Add(onVesselLoaded); GameEvents.onVesselRecovered.Add(onVesselRecovered); GameEvents.onVesselWillDestroy.Add(onVesselWillDestroy); GameEvents.onVesselGoOffRails.Add(onVesselLoaded); GameEvents.onVesselPartCountChanged.Add(OnVesselWasModified); GameEvents.onEditorPartPlaced.Add(onEditorPartPlaced); GameEvents.onEditorPodPicked.Add(onEditorPartPlaced); GameEvents.onEditorPartEvent.Add(onEditorPartEvent); GameEvents.onEditorPodSelected.Add(onEditorPartPlaced); Instance = this; } catch (Exception ex) { Debug.Log("Snacks - Awake error: " + ex.Message + ex.StackTrace); } }
public void RefillSnackPack() { if (FlightGlobals.ActiveVessel.isEVA && SnackController.IsExperienceEnabled()) { Vessel vessel = FlightGlobals.ActiveVessel; ProtoCrewMember astronaut = vessel.GetVesselCrew()[0]; } }