示例#1
0
        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;
                }
            }
        }
示例#3
0
 private static void LoadSettings()
 {
     generalSettings   = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();
     aviationLSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_AviationLightsSettings> ();
     settingsLoaded    = true;
 }