public void Start() { settings = HighLogic.CurrentGame.Parameters.CustomParams <CL_SunLightSettings> (); generalSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> (); aviationLightsSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_AviationLightsSettings> (); vessel = this.GetComponent <Vessel> (); // Checking for the type cannot be done earlier unfortunalely, it won't be correctly assigned if (vessel.vesselType == VesselType.Debris || vessel.vesselType == VesselType.EVA || vessel.vesselType == VesselType.Flag || vessel.vesselType == VesselType.SpaceObject) { Destroy(this); } StartCoroutine("StartSunLight"); }
public override void OnStart(StartState state) { CL_AviationLightsSettings settings = HighLogic.CurrentGame.Parameters.CustomParams <CL_AviationLightsSettings> (); if (!HighLogic.LoadedSceneIsFlight || !settings.beaconOnEngine) { Destroy(this); } foreach (PartModule pm in part.Modules) { if (pm.ClassName == "ModuleNavLight") { navLight = pm; break; } } }
private static void LoadSettings() { generalSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> (); aviationLSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_AviationLightsSettings> (); settingsLoaded = true; }